-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
61 lines (52 loc) · 1.54 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
# Use Ubuntu 16.04 as the base container
FROM ubuntu:16.04
# Update the system and install packages
RUN apt-get -y -qq update && apt-get -y -qq install \
docker.io \
python \
python-dev \
python-pip \
postgresql-server-dev-all \
libldap2-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
libffi-dev \
postgresql-client-9.5 \
libmysqlclient-dev \
mariadb-client-10.0 \
apt-transport-https \
ca-certificates \
uwsgi \
uwsgi-core \
uwsgi-plugin-python \
curl \
software-properties-common
# install docker-ce
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get -y -qq update && \
apt-get -y -qq install docker-ce
# Create the sttrweb user and data directory
RUN mkdir /opt/DB4SCI && \
mkdir /mydb && \
mkdir /mydb/db_data && \
mkdir /mydb/db_backups && \
mkdir -p /var/run/postgresdb
RUN groupadd -f --gid 999 db4sci
RUN useradd -u 999 -g 999 -s /bin/nologin docker
# Install Python packages
ADD requirements.txt /opt/DB4SCI/
RUN pip install pip==9.0.1 && pip install -r /opt/DB4SCI/requirements.txt
# Copy files to container
ENV env dev
ADD *.py /opt/DB4SCI/
#ADD ${env}/neo4j /opt/DB4SCI/neo4j
ADD TLS /opt/DB4SCI/TLS
ADD dbconfig /opt/DB4SCI/dbconfig
ADD mydb /opt/DB4SCI/mydb/
ADD uwsgi.ini /opt/DB4SCI/
# Switch to the server directory and start it up
WORKDIR /opt/DB4SCI
CMD ["uwsgi", "--ini", "uwsgi.ini"]