forked from mrchoke/nginx-unit-python-django
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 911 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 911 Bytes
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
FROM python:3.6-slim
ENV DJANGO_VERSION 1.11.4
ENV UNIT_VERSION 0.1
RUN apt-get update && apt-get install -y \
gcc \
gettext \
mysql-client libmysqlclient-dev \
sqlite3 build-essential wget curl \
--no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& cd /tmp && wget -O - "http://unit.nginx.org/download/unit-$UNIT_VERSION.tar.gz" | tar xvz \
&& cd unit-$UNIT_VERSION \
&& ./configure --prefix=/usr --modules=lib --control='*:8000' --log=/dev/stdout --pid=/var/run/unitd.pid \
&& ./configure python --module=py36\
&& make install \
&& pip install mysqlclient django=="$DJANGO_VERSION" \
&& rm -rf /tmp/unit-$UNIT_VERSION \
&& apt-get remove --auto-remove -y build-essential wget
ADD app.tar.gz /srv
# && cd /srv && django-admin startproject app
WORKDIR /srv/app
EXPOSE 8000 8080
CMD ["/usr/sbin/unitd", "--no-daemon"]