-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 904 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 904 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
# Based on
# https://medium.com/@greut/minimal-python-deployment-on-docker-with-uwsgi-bc5aa89b3d35
# but not using Alpine because this distribution is not compatible with Python manylinux binaries.
FROM python:3.8.2-slim-buster as backendbase
ENV WSB_PORT=3031
RUN apt-get update && apt-get install -y build-essential libpq-dev python3-dev \
&& pip3 install uwsgi psycopg2 \
&& apt-get remove -y --purge build-essential libpq-dev python3-dev
COPY ./requirements.txt .
# Install all requirements
RUN pip3 install -r requirements.txt
FROM backendbase
# Create a working directory named app
WORKDIR /app
# Copy everything into the working directory
COPY . .
# Change ownership of the app folder to match the user running uwsgi
RUN chown -R www-data:www-data /app
# uWSGI will be available on this port
EXPOSE $WSB_PORT
CMD [ "uwsgi", "--uid", "uwsgi", \
"--ini", "uwsgi.ini"]