-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
36 lines (27 loc) · 872 Bytes
/
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
FROM fedora:34
MAINTAINER Marcelo Moreira de Mello <[email protected]>
ENV PORT 8000
# create django-app user
RUN useradd django-app
# update and install dependencies
RUN dnf clean all && \
dnf -y update && \
dnf -y install python3 python3-devel python3-pip git \
sqlite openssl-devel && \
dnf clean all
# create directory and mount sources there
ADD start.sh requirements.txt mysslcerts /home/django-app/code/
RUN chmod +x /home/django-app/code/start.sh
ADD .bashrc /home/django-app/
RUN chown django-app:django-app -R /home/django-app
# set user
USER django-app
# set workdir
WORKDIR /home/django-app/code
RUN pip install -r /home/django-app/code/requirements.txt
# export volume
VOLUME /home/django-app/code
# expose 8000 port
EXPOSE ${PORT}
# define command to start container
ENTRYPOINT ["/bin/bash", "/home/django-app/code/start.sh"]