-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrom-scratch-dockerfile
67 lines (45 loc) · 1.65 KB
/
from-scratch-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
FROM ubuntu:16.04 as temp1
LABEL maintainer="e_ben_75-python@yahoo.com" \
important-stopping-note="Stop the server by running apache2ctl stop, this will keep from process hang" \
description="This is a base Apache2, Python 2.7.12, Python MySQL-python, and mod_wsgi web server for Django." \
package-name="apache-py2-django" \
image-version="1.1" \
django-version="1.11.2" \
django-localflavor-version="1.5.1" \
mysql-python-version="1.2.5"
RUN apt-get update && apt-get install -y apache2 \
python \
python-pip \
python-dev \
libmysqlclient-dev \
libapache2-mod-wsgi \
&& apt-get clean \
&& mkdir /DjangoSites \
&& chmod 755 /DjangoSites \
&& pip install --upgrade pip \
&& pip install Django==1.11.2 \
&& pip install django-localflavor==1.5.1 \
&& pip install MySQL-python
EXPOSE 80 443
ENTRYPOINT ["apache2ctl", "-D", "FOREGROUND"]
FROM temp1 as temp2
LABEL image-version="1.2"
# Copies the apache conf python script
COPY ./apache-site-conf.py /bin/
RUN chmod 755 /bin/apache-site-conf.py
# Environment variables for Apache conf file builder script if not used, they will use default settings
# SITE_SERVER_NAME=www.example.com
# SITE_SERVER_ADMIN=webmaster@localhost
ENV SITE_SERVER_NAME=www.example.com
ENV SITE_SERVER_ADMIN=webmaster@localhost
# Directory where Django Sites go
WORKDIR /DjangoSites
FROM temp2 as temp3
LABEL image-version="1.3"
# Copies the apache conf shell script
COPY ./apache-site-conf.sh /bin/
RUN chmod 755 /bin/apache-site-conf.sh
FROM temp3 as temp4
LABEL image-version="1.4"
# SITE_DIRECTORY_NAME = MySiteDir
ENV SITE_DIRECTORY_NAME=MySiteDir