-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
39 lines (30 loc) · 1.47 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
31
32
33
34
35
36
37
38
39
FROM python:3.12-slim-bullseye
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="ManoManoTech"
LABEL org.opencontainers.image.description="FireFighter runtime image"
LABEL org.opencontainers.image.url="https://github.com/ManoManoTech/firefighter-incident/"
LABEL org.opencontainers.image.documentation="https://github.com/ManoManoTech/firefighter-incident/"
LABEL org.opencontainers.image.vendor="Colibri SAS"
LABEL org.opencontainers.image.authors="[email protected]"
# add our user and group first to make sure their IDs get assigned consistently
RUN groupadd -r firefighter && useradd -r -m -g firefighter firefighter
# Sane defaults for pip
ENV \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install dependencies first to leverage Docker layer caching.
RUN --mount=type=bind,source=requirements.txt,target=/tmp/requirements.txt \
pip install -r /tmp/requirements.txt
RUN --mount=type=bind,source=dist,target=/tmp/app_dist \
pip install /tmp/app_dist/*.whl --no-deps && pip check
EXPOSE 8000
VOLUME /data
WORKDIR /var/app
# We don't have the dev dependencies in the image
ENV ENV=prod
ENV DEBUG=False
USER firefighter
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["ff-web"]
LABEL org.opencontainers.image.source="https://github.com/ManoManoTech/firefighter-incident/tree/${SOURCE_COMMIT:-master}/"
LABEL org.opencontainers.image.licenses="https://github.com/ManoManoTech/firefighter-incident/blob/${SOURCE_COMMIT:-master}/LICENSE"