This repository was archived by the owner on Apr 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (46 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
55 lines (46 loc) · 1.92 KB
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
FROM debian:stretch
# Install additional Debian packages
RUN apt-get -y update && apt-get upgrade -y && apt-get install -y \
vim python python-pip python-dev\
openssl userv openssh-client \
apache2 apache2-utils libapache2-mod-wsgi libpq5 \
libssl-dev libjpeg-dev netcat zlib1g-dev \
libpq-dev build-essential git
# Update pip and install Python dependencies. Note that vmmanager is installed
# from a local copy of the source. We use pip install -e to install vmmanager so
# that, if a local developer mounts the vmmanager sources as a volume, changes
# in the sources are reflected within the container. We clean up the apt cache
# and build dependencies afterwards
COPY mws/requirements.txt ./
COPY vmmanager /usr/src/vmmanager
RUN pip install /usr/src/vmmanager && \
pip install --upgrade -r requirements.txt && \
apt-get -y purge python-dev libssl-dev libjpeg-dev \
zlib1g-dev libpq-dev build-essential && \
apt-get -y autoremove && apt-get -y clean
# Provide wait-for-it within the container
COPY docker/wait-for-it.sh ./
RUN install wait-for-it.sh /usr/local/bin/wait-for-it
# Copy Apache config
COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
# Copy MWS webapp
COPY mws /usr/src/app
# Add volumes to allow overriding container contents with local directories for
# development.
VOLUME ["/usr/src/app"]
VOLUME ["/usr/src/vmmanager"]
# Environment variables to override Django settings module and default database
# configuration. Note: at least DJANGO_DB_PASSWORD should be set.
ENV DJANGO_SETTINGS_MODULE=mws.settings \
DJANGO_DB_ENGINE=django.db.backends.postgresql_psycopg2 \
DJANGO_DB_NAME=mws \
DJANGO_DB_HOST=db \
DJANGO_DB_PORT=5432 \
DJANGO_DB_USER=panel
# Other variables:
# DJANGO_DB_PASSWORD
# DJANGO_EMAIL_HOST
# DJANGO_EMAIL_PORT
WORKDIR /usr/src/app
EXPOSE 80
ENTRYPOINT ["apache2ctl", "-D", "FOREGROUND"]