-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (32 loc) · 873 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
30
31
32
33
34
35
36
37
38
39
40
41
42
# Docker image for the Reservation API.
#
# Please set the following env vars:
#
# - SECRET_KEY=...
# - DATABASE_URL='postgres://<postgres-host>/<database-name>'
# - ALLOWED_HOST='reservations.coredump.ch'
FROM docker.io/python:3.13-slim-bookworm
ARG REQUIREMENTS_FILE=requirements.txt
# Add requirements file
ADD requirements*.txt /code/
WORKDIR /code
# Install dependencies
RUN apt-get update -qq \
&& apt-get install -yq --no-install-recommends \
dumb-init \
&& rm -rf /var/lib/apt/lists/*
RUN pip install -r $REQUIREMENTS_FILE
# Add code
ADD . /code
# Set env vars
ENV DJANGO_DEBUG=False
# Volumes
VOLUME ["/code/static/", "/code/media/"]
# Port
EXPOSE 8000
# Healthcheck
HEALTHCHECK --interval=30s --timeout=5s \
CMD python /code/docker/healthcheck.py
# Entry point
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/bash", "docker/entrypoint.sh"]