-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 769 Bytes
/
Dockerfile
File metadata and controls
34 lines (26 loc) · 769 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
29
30
31
32
33
34
# Base image
FROM python:3.7-slim-stretch
# Working directory
WORKDIR /app
# Environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV LANG C.UTF-8
# Copy dependencies
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
COPY docker-entrypoint.sh /docker-entrypoint.sh
# Install dependencies
RUN apt-get update \
&& apt-get install -y \
swig libssl-dev dpkg-dev \
&& pip install -U pip pipenv gunicorn Faker \
&& pipenv lock --requirements > requirements.txt \
&& pip install -r requirements.txt \
&& chmod +x /docker-entrypoint.sh
# Copy other files to docker container
COPY . .
# Switch users
RUN groupadd -r docker && useradd --no-log-init -r -g docker docker
USER docker
CMD ["python3", "manage.py", "runserver"]