-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
71 lines (54 loc) · 2.55 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
FROM tomcat:9.0.46-jdk8-openjdk-buster
MAINTAINER Lee Evans - www.ltscomputingllc.com
# OHDSI WebAPI and ATLAS web application running in Tomcat
# set the WEBAPI_RELEASE environment variable within the Docker container
ENV WEBAPI_RELEASE=2.12.0
# optionally override the war file url when building this container using: --build-arg WEBAPI_WAR=<webapi war file name>
ARG WEBAPI_WAR=WebAPI-2.12.0.war
# install linux utilities and supervisor daemon
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
unzip \
supervisor \
build-essential \
nodejs \
curl \
git-core \
&& rm -rf /var/lib/apt/lists/*
# install specific npm version for this build
WORKDIR ~
RUN curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh \
&& chmod +x nodesource_setup.sh \
&& bash nodesource_setup.sh
RUN apt-get update && apt-get install -y --no-install-recommends \
npm \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g npm@7
# deploy the OHDSI WEBAPI and OHDSI ATLAS web application to the Tomcat server
# set working directory to the Tomcat server webapps directory
WORKDIR /usr/local/tomcat/webapps
# deploy the released OHDSI WebAPI war file from the OHDSI CI Nexus repository
ENV WEBAPI_WAR_URL=https://repo.ohdsi.org/nexus/repository/releases/org/ohdsi/WebAPI/$WEBAPI_RELEASE/$WEBAPI_WAR
RUN wget $WEBAPI_WAR_URL \
&& mv /usr/local/tomcat/webapps/WebAPI*.war /usr/local/tomcat/webapps/WebAPI.war
# deploy the released OHDSI Atlas web application
RUN wget https://github.com/OHDSI/Atlas/archive/v$WEBAPI_RELEASE.zip \
&& unzip /usr/local/tomcat/webapps/v$WEBAPI_RELEASE.zip \
&& mv /usr/local/tomcat/webapps/Atlas-$WEBAPI_RELEASE /usr/local/tomcat/webapps/atlas \
&& rm -f v$WEBAPI_RELEASE.zip
# bundle the OHDSI Atlas code modules
WORKDIR /usr/local/tomcat/webapps/atlas
RUN npm run build
# create directories for optional jdbc drivers and the log files
RUN mkdir -p /tmp/drivers /var/log/supervisor
# install supervisord configuration file
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# install Atlas local configuration file
COPY config-local.js /usr/local/tomcat/webapps/atlas/js/
# install Atlas GIS local configuration file
COPY config-gis.js /usr/local/tomcat/webapps/atlas/js/
# install the bash shell deploy script that supervisord will run whenever the container is started
COPY deploy-script.sh /usr/local/tomcat/bin/
RUN chmod +x /usr/local/tomcat/bin/deploy-script.sh
# run supervisord to execute the deploy script (which also starts the tomcat server)
CMD ["/usr/bin/supervisord"]