-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (25 loc) · 816 Bytes
/
Dockerfile
File metadata and controls
44 lines (25 loc) · 816 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
35
36
37
38
39
40
41
42
FROM python:3.8.0-slim
RUN apt-get update && apt-get install -qq -y \
build-essential libpq-dev --no-install-recommends
# create directory for the app user
ENV INSTALL_PATH /app
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
# create the app user
RUN useradd -ms /bin/bash app
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip
#professional lint checking
RUN pip install flake8
RUN pip install sqlalchemy-utils
RUN pip install -r requirements.txt
COPY . .
RUN pip install --editable .
# chown all the files to the app user
RUN chown -R app:app $INSTALL_PATH
# change to the app user
USER app
ENV PORT=8000
# Run the app. CMD is required to run on Heroku
# $PORT is set by Heroku
CMD gunicorn --bind 0.0.0.0:$PORT "app.app:create_app('config.setting.ProdConfig')"