-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (33 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
50 lines (33 loc) · 1.09 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
FROM tiangolo/uwsgi-nginx:python3.6
ENV NGINX_MAX_UPLOAD 16m
# If you prefer miniconda:
#FROM continuumio/miniconda3
ENV LISTEN_PORT=8000
EXPOSE 8000
ENV DJANGO_SECRET_KEY p!63vi=_4)o5h8k0ep4uy2e6ou^k$9wels#e&&x=^^!=$xa21o
# Indicate where uwsgi.ini lives
ENV UWSGI_INI uwsgi.ini
# Tell nginx where static files live (as typically collected using Django's
# collectstatic command.
WORKDIR /app
COPY requirements.txt /app
# Using pip:
RUN python3 -m pip install -r requirements.txt
ENV STATIC_URL /app/static/
COPY . /app
# Make app folder writable for the sake of db.sqlite3, and make that file also writable
RUN chmod g+w /app
RUN chmod g+w /app/db.sqlite3
# ssh
ENV SSH_PASSWD "root:Docker!"
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "$SSH_PASSWD" | chpasswd
COPY sshd_config /etc/ssh/
COPY init.sh /usr/local/bin/
RUN chmod u+x /usr/local/bin/init.sh
EXPOSE 8000 2222
CMD ["python", "/app/manage.py", "runserver", "0.0.0.0:8000"]
ENTRYPOINT ["init.sh"]