-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (26 loc) · 902 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
FROM python:3.7-alpine
MAINTAINER Sachin_Lucas_Apratim
# recommended to run with this in docker container
ENV PYTHONUNBUFFERED 1
# Dependencies from requirement.txt -> docker
COPY ./requirements.txt /requirements.txt
# run pip on it
RUN pip install --upgrade pip
RUN apk add gcc musl-dev python3-dev libffi-dev openssl-dev libffi-dev
RUN pip install -r requirements.txt
# -----------------------------------
#Application source code here
RUN mkdir /app
# This will be the working directory -> this will be staring
# directory
WORKDIR /app
# copy the code dev writes into docker
COPY ./app /app
# ------------------------------------
# Create user that will run the app using docker
# -D means user can only run project not admin
RUN adduser -D user
# Switch user to user we created
# prevents the user from having root access and have only
# access to our application in our container
USER user