2024-06-03 15:17:38 +02:00
|
|
|
FROM debian:12
|
|
|
|
|
|
|
|
ARG SCODOC_VERSION=dev \
|
|
|
|
SCODOC_COMMIT=dev \
|
|
|
|
IMAGE_DATE=dev
|
|
|
|
|
|
|
|
LABEL org.opencontainers.image.created=$IMAGE_DATE \
|
|
|
|
org.opencontainers.image.authors="ScoDoc" \
|
|
|
|
org.opencontainers.image.url="https://scodoc.org" \
|
|
|
|
org.opencontainers.image.documentation="https://scodoc.org" \
|
|
|
|
org.opencontainers.image.source="https://git.scodoc.org/ScoDoc/ScoDoc.git" \
|
|
|
|
org.opencontainers.image.version=$SCODOC_VERSION \
|
|
|
|
org.opencontainers.image.vendor="ScoDoc" \
|
|
|
|
org.opencontainers.image.licenses="GPL-2.0-only" \
|
|
|
|
org.opencontainers.image.ref.name=$SCODOC_COMMIT \
|
|
|
|
org.opencontainers.image.title="ScoDoc" \
|
|
|
|
org.opencontainers.image.description="ScoDoc: un logiciel libre pour le suivi de la scolarité"
|
|
|
|
|
|
|
|
COPY . /opt/scodoc
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get upgrade --yes \
|
|
|
|
&& useradd --shell /bin/bash --create-home --comment "ScoDoc service" scodoc \
|
|
|
|
&& mkdir -p /opt/scodoc-data \
|
|
|
|
&& chown -R scodoc:scodoc /opt/scodoc /opt/scodoc-data \
|
|
|
|
&& apt-get install --yes curl gcc graphviz graphviz-dev libpq-dev cracklib-runtime libcrack2-dev libpango-1.0-0 pango1.0-tools python3-dev python3-venv python3-pip python3-wheel postgresql-client \
|
|
|
|
&& apt-get clean \
|
2024-06-07 15:08:15 +02:00
|
|
|
&& su -c "(cd /opt/scodoc && python3 -m venv venv && source venv/bin/activate && pip install wheel && pip install -r requirements-3.11.txt)" scodoc \
|
|
|
|
&& rm -rf ~scodoc/.cache/pip
|
2024-06-03 15:17:38 +02:00
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
HEALTHCHECK CMD curl --fail http://127.0.0.1:8000 || exit 1
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/opt/scodoc/tools/docker-entrypoint.sh" ]
|