-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.08 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (26 loc) · 1.08 KB
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
FROM python:3.12-slim-bookworm
# No real default: the release workflow passes the tag. A version baked in
# here goes stale the moment it is not bumped, and then the image reports a
# release it is not.
ARG QUOTO_VERSION=dev
ARG QUOTO_REVISION=unknown
LABEL org.opencontainers.image.title="Quoto" \
org.opencontainers.image.version="${QUOTO_VERSION}" \
org.opencontainers.image.revision="${QUOTO_REVISION}"
ENV QUOTO_VERSION=${QUOTO_VERSION}
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Run as a non-root user; own /app (incl. the logs dir backing the volume).
RUN useradd --create-home --uid 1000 quoto \
&& mkdir -p /app/logs \
&& chown -R quoto:quoto /app
USER quoto
# Liveness: heartbeat is refreshed by the scheduler; stale => loop is wedged.
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD ["python", "/app/healthcheck.py"]
CMD ["sh", "/app/docker-entrypoint.sh"]