-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
62 lines (49 loc) · 1.57 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
62
FROM python:3.6-slim
# Enable production settings by default; for development, this can be set to
# `false` in `docker run --env`
ENV DJANGO_PRODUCTION=true
ENV PYTHONBUFFERED 1
# Set terminal to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
# Enable MySQL root user creation without interactive input
#RUN echo 'mysql-server mysql-server/root_password password devrootpass' | debconf-set-selections
#RUN echo 'mysql-server mysql-server/root_password_again password devrootpass' | debconf-set-selections
# Install packages
#RUN apt-get update && apt-get install -y \
# git \
# libmysqlclient-dev \
# mysql-server \
# nginx \
# python-dev \
# python-mysqldb \
# python-setuptools \
# supervisor \
# vim \
# curl
#RUN easy_install pip
# Handle urllib3 InsecurePlatformWarning
#RUN apt-get install -y libffi-dev libssl-dev libpython2.7-dev
#RUN pip install urllib3[security] requests[security] ndg-httpsclient pyasn1
# Configure Django project
RUN mkdir /code
#RUN mkdir /djangomedia
#RUN mkdir /static
RUN mkdir /logs
#RUN mkdir /logs/nginx
RUN mkdir /logs/gunicorn
WORKDIR /code
# Expose ports
# 80 = Nginx
# 8000 = Gunicorn
# 3306 = MySQL
EXPOSE 80 8000
# Configure Nginx
#RUN ln -s /code/nginx.conf /etc/nginx/sites-enabled/django_docker.conf
#RUN rm /etc/nginx/sites-enabled/default
# Run Supervisor (i.e., start MySQL, Nginx, and Gunicorn)
#COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD requirements.txt /code/
RUN pip3 install -r requirements.txt
ADD . /code
#RUN chmod ug+x /code/initialize.sh
CMD ["/bin/sh","/code/initialize.sh"]