-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
30 lines (20 loc) · 908 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
FROM python:3.6-stretch
# We don't want to run our application as root if it is not strictly necessary, even in a container.
# Create a user and a group called 'app' to run the processes.
# A system user is sufficient and we do not need a home.
RUN adduser --system --group --no-create-home app
# Place the application components in a dir below the root dir
COPY . /app
# Make the directory the working directory for subsequent commands
WORKDIR /app
# Install from the requirements.txt we copied above
RUN pip install -r requirements.txt
# Hand everything over to the 'app' user
RUN chown -R app:app /app
# Subsequent commands, either in this Dockerfile or in a
# docker-compose.yml, will run as user 'app'
USER app
# We are done with setting up the image.
# As this image is used for different
# purposes and processes no CMD or ENTRYPOINT is specified here,
# this is done in docker-compose.yml.