-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.demo
61 lines (52 loc) · 1.53 KB
/
Dockerfile.demo
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/dbaas && \
mkdir /mydb && \
mkdir /mydb/db_data && \
mkdir /mydb/db_backups && \
mkdir -p /var/run/postgresdb
RUN groupadd -f --gid 999 dbaas
RUN useradd -u 999 -g 999 -s /bin/nologin docker
# Install Python packages
ADD requirements.txt /opt/dbaas/
RUN pip install pip==18.1 && pip install -r /opt/dbaas/requirements.txt
# Copy files to container
ENV env dev
ADD *.py /opt/dbaas/
#ADD ${env}/neo4j /opt/dbaas/neo4j
ADD TLS /opt/dbaas/TLS
ADD dbconfig /opt/dbaas/dbconfig
ADD mydb /opt/dbaas/mydb/
ADD uwsgi.ini /opt/dbaas/
# Switch to the server directory and start it up
WORKDIR /opt/dbaas
CMD ["uwsgi", "--ini", "uwsgi.ini"]