-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
30 lines (22 loc) · 1.01 KB
/
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
# Pull base image
FROM python:3.8.0-alpine
# set work directory
WORKDIR /usr/src/activity
RUN apk --update --upgrade add gcc musl-dev jpeg-dev zlib-dev libffi-dev cairo-dev pango-dev gdk-pixbuf
# make psycopg2-binary install on alpine
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1 #Prevents Python from writing pyc files to disc
ENV PYTHONUNBUFFERED 1 #Prevents Python from buffering stdout and stderr
# Install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt /usr/src/activity/requirements.txt
# Fix of https://github.com/pyca/cryptography/issues/5771
# starting cryptography>=3.5, Rust is required to build it (or a later version of PIP for wheel download)
# Updating cryptography requries Rust installation
# In cryptography < 3.5, which we use, it can be disabled using the below env var
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
RUN pip install -r requirements.txt
# Copy project.
COPY . /usr/src/activity/
ENTRYPOINT ["sh", "start.sh"]