-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (27 loc) · 1007 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
# Pull base image
FROM python:3.8
# This will add scripts to the path of the running container
# ENV PATH="/scripts:${PATH}"
# Set environment variables
# PYTHONUNBUFFERED ensures our console output looks familiar
# and is not buffered by Docker
ENV PYTHONUNBUFFERED 1
# PYTHONDONTWRITEBYTECODE means Python won't try to write .pyc files
ENV PYTHONDONTWRITEBYTECODE 1
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Create and set working directory
# set the WORKDIR to /code. This means the working directory is
# located at /code so in the future to run any commands like
# manage.py we can just use WORKDIR rather than need to remember
# where exactly on Docker our code is actually located.
RUN mkdir /code
WORKDIR /code
# install environment dependencies
RUN pip3 install --upgrade pip
RUN pip3 install pipenv
COPY requirements.txt /code/
RUN pip install -r requirements.txt
# Using below command we can run docker as non
# root user, which is a good practice
# RUN adduser -D user