-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 806 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 806 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
FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.9-slim
ENV MAX_WORKERS=10
# Create the working directory
WORKDIR /pixels
# Install project dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev
# Copy in the Gunicorn config
COPY ./gunicorn_conf.py /gunicorn_conf.py
# Define Git SHA build argument
ARG git_sha="development"
# Set Git SHA environment variable for Sentry
ENV GIT_SHA=$git_sha
# Copy the source code in last to optimize rebuilding the image
COPY . .
EXPOSE 80
# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations),
# and then it will start Gunicorn with Uvicorn workers.
ENTRYPOINT ["poetry", "run"]
CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "-c", "/gunicorn_conf.py", "pixels:app"]