Files
Enclume/Dockerfile
T
hcornet b063d59525
build / Garde-fou (pull_request) Failing after 7s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Garde-fou (push) Failing after 8s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Skipped
build / Images Harbor (web, Dockerfile) (push) Skipped
Partage par lien, comptes Authentik, soumission et moderation de packs, prerequis des sondes ; corrige le lien casse vers le script de l'editeur
2026-09-10 16:28:26 +02:00

55 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
# ---------------------------------------------------------------- construction
FROM python:3.12-slim AS build
ENV PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /build
COPY requirements.txt ./
RUN python -m venv /opt/venv \
&& /opt/venv/bin/pip install --no-cache-dir -r requirements.txt
# ------------------------------------------------------------------- execution
FROM python:3.12-slim AS runtime
ARG ENCLUME_VERSION=dev
ARG ENCLUME_COMMIT=inconnu
ARG BUILD_DATE=inconnue
LABEL org.opencontainers.image.title="Enclume" \
org.opencontainers.image.description="Generateur de configuration CLAPI pour Centreon" \
org.opencontainers.image.version="${ENCLUME_VERSION}" \
org.opencontainers.image.revision="${ENCLUME_COMMIT}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.licenses="MIT"
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PATH="/opt/venv/bin:$PATH" \
ENCLUME_VERSION="${ENCLUME_VERSION}" \
ENCLUME_COMMIT="${ENCLUME_COMMIT}" \
ENCLUME_CATALOG=/app/catalog \
GUNICORN_WORKERS=2 \
GUNICORN_TIMEOUT=30
RUN groupadd --gid 10001 enclume \
&& useradd --uid 10001 --gid enclume --home /app --no-create-home --shell /usr/sbin/nologin enclume
COPY --from=build /opt/venv /opt/venv
WORKDIR /app
COPY --chown=root:root enclume/ /app/enclume/
COPY --chown=root:root catalog/ /app/catalog/
COPY --chown=root:root migrations/ /app/migrations/
COPY --chown=root:root alembic.ini /app/alembic.ini
COPY --chown=root:root docker/entrypoint-web.sh /usr/local/bin/entrypoint-web
RUN chmod +x /usr/local/bin/entrypoint-web
USER enclume
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/sante', timeout=4).status==200 else 1)"
CMD ["/usr/local/bin/entrypoint-web"]