-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (48 loc) · 1.76 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
FROM ubuntu:14.04
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install apt package dependencies
RUN apt-get clean all && apt-get update && \
apt-get -y install wget curl python make g++ git supervisor unzip && \
apt-get clean all
# Add spcies data from ITIS
RUN wget https://s3.amazonaws.com/bsve-integration/itisSqlite.zip
# Install nodejs
RUN wget https://nodejs.org/download/release/v8.9.1/node-v8.9.1-linux-x64.tar.gz && \
tar -zxf node-v8.9.1-linux-x64.tar.gz && \
rm node-v8.9.1-linux-x64.tar.gz
ENV PATH $PATH:/node-v8.9.1-linux-x64/bin
#Add in the repo
ADD . /eidr-connect
ADD eidr-connect.sh .
WORKDIR /eidr-connect
# Install Meteor
RUN curl https://install.meteor.com/ | sh
#Create and use meteor user
RUN groupadd meteor && adduser --ingroup meteor --home /home/meteor meteor
RUN chown -R meteor:meteor /eidr-connect
USER meteor
RUN meteor list
RUN cd imports/incident-resolution && meteor npm link
RUN meteor npm link incident-resolution
RUN meteor npm install
RUN meteor build /home/meteor/build --directory
WORKDIR /home/meteor/build/bundle/programs/server
RUN npm install
# The worker thread does not have access to the npm modules bundled with the app.
# In order for the worker to import the incident-resolution lib it needs to be
# installed into the budled app's node modules.
RUN meteor npm install /eidr-connect/imports/incident-resolution
WORKDIR /
#Switch back to root user
USER root
# Add the application files
ADD supervisor-eidr-connect.conf /etc/supervisor/conf.d/eidr-connect.conf
ADD run.sh /run.sh
RUN cd /eidr-connect && git rev-parse HEAD > /home/meteor/build/bundle/revision.txt
# Prepare for production
LABEL app="eidr-connect"
EXPOSE 3000
VOLUME /shared
# Start application
CMD /bin/bash /run.sh