This repository has been archived by the owner on Sep 8, 2021. It is now read-only.
forked from pmarrone/dspace-dev-docker
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
153 lines (115 loc) · 4.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
FROM ubuntu:xenial
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
vim \
wget \
byobu \
git \
bash-completion \
software-properties-common \
postgresql-client \
openjdk-8-jdk \
ant \
maven \
unzip
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
WORKDIR /tmp
#DCEVM installation
#Since DCEVM for Xenial seems kind of broken, we download it from zetzy
RUN wget http://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8-jre-dcevm/openjdk-8-jre-dcevm_8u112-2_amd64.deb && \
dpkg -i openjdk-8-jre-dcevm_8u112-2_amd64.deb
# Install Tomcat 8
ENV CATALINA_HOME=/usr/local/tomcat
ENV TOMCAT_MAJOR=8 TOMCAT_VERSION=8.0.44
ENV TOMCAT_TGZ_URL=https://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz
RUN mkdir -p $CATALINA_HOME
RUN wget "$TOMCAT_TGZ_URL" -O tomcat.tar.gz \
&& tar -xvf tomcat.tar.gz --strip-components=1 -C "$CATALINA_HOME"
ENV PATH=$CATALINA_HOME/bin:$PATH
#Create DSpace folders
RUN mkdir -p /srv/dspace /srv/dspace-src
ENV DSPACE_HOME=/srv/dspace
ENV PATH=$DSPACE_HOME/bin:$PATH
RUN mkdir /root/.m2
#VOLUME /root/.m2
###
# Bash configuration
###
#Configure colors and autocompletion
COPY bashrc /root/.bashrc
COPY bashrc /home/developer/.bashrc
#Configure some useful aliases
COPY bash_aliases /root/.bash_aliases
COPY bash_aliases /home/developer/.bash_aliases
ENV DSPACE_HOME=/srv/dspace
ENV PATH=$DSPACE_HOME/bin:$PATH
###
# Tomcat configuration tweaks
###
# Configure remote debugging and extra memory
COPY setenv.sh $CATALINA_HOME/bin
#Install Hotswap agent
#COPY HotswapAgent-0.3.zip /usr/lib/hotswapagent/HotswapAgent-0.3.zip
RUN wget https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-0.3/HotswapAgent-0.3.zip -O HotswapAgent.zip
RUN mkdir /usr/lib/hotswapagent
RUN unzip HotswapAgent.zip -d /usr/lib/hotswapagent/
RUN rm HotswapAgent.zip
RUN apt install -y sudo
RUN export HOME=/home/developer
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${uid}:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer
RUN chown -R developer $CATALINA_HOME
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
#ENTRYPOINT ["/entrypoint.sh"]
#Install PSI Probe
RUN wget https://github.com/psi-probe/psi-probe/releases/download/2.4.0/probe-2.4.0.zip -O probe.zip
RUN unzip probe.zip
# RUN mv probe.war $CATALINA_HOME/webapps/probe.war
COPY conf $CATALINA_HOME/conf
RUN wget https://deb.nodesource.com/setup_6.x -O -| sudo bash - \
&& apt-get install nodejs -y
RUN npm install -g grunt bower
###
# Installing an IDE
###
#Download the IDE
#ADD https://download.jetbrains.com/idea/ideaIC-2016.1.2.tar.gz /home/developer/idea
#Required for running Idea IDE
#RUN apt-get install libxext-dev libxrender-dev libxtst-dev -y
#To make intellij work. For some reason, it requires the fonts to be installed
#RUN apt-get install fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-extra -y
#Uncomment this lines to set a custom UID. E.g.: 1009
#RUN export uid=1009 && usermod -u $uid developer
#RUN chown -R developer:developer /home/developer
RUN apt-get install -y locales && locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
#Also, give developer ownership of CATALINA_HOME
RUN chown -R developer:developer $CATALINA_HOME/
USER developer
USER developer
#Install ruby deps
RUN sudo apt-get install -y bison build-essential zlib1g-dev libssl-dev libxml2-dev git-core
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \
&& curl -sSL https://raw.githubusercontent.com/wayneeseguin/rvm/stable/binscripts/rvm-installer | bash -s stable --ruby
RUN bash -c "source ~/.profile \
&& gem install sass -v 3.3.14 \
&& gem install compass -v 1.0.1"
RUN echo "source ~/.profile" >> ~/.bashrc
###
# Cleanup
###
RUN sudo rm -rf /var/lib/apt/lists/*
#Link DSpace binary
RUN sudo ln -s /srv/dspace/bin/dspace /usr/bin/dspace
WORKDIR /srv/dspace-src
EXPOSE 1043:1043
EXPOSE 8080:8080
EXPOSE 8000:8000