FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Dockerfile 965 B
###############################################################################
# Base image for all others to build upon.
#
# If you change the version here, update pyproject.toml and the version used in
# CI.
FROM registry.gitlab.developers.cam.ac.uk/uis/devops/infra/dockerimages/python:3.11-slim AS base

# Some performance and disk-usage optimisations for Python within a docker container.
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1

WORKDIR /usr/lib

RUN adduser --system --no-create-home nonroot

# Pretty much everything from here on needs poetry.
RUN pip install --no-cache-dir poetry

COPY pyproject.toml poetry.lock README.md ./
COPY ucam_faas ./ucam_faas

COPY gunicorn.conf.py /etc/gunicorn.conf.py

RUN poetry config virtualenvs.create false && \
    poetry install --without=dev

WORKDIR /usr/src/app

USER nonroot

HEALTHCHECK --interval=5m --timeout=3s \
  CMD curl -f http://localhost/healthy || exit 1

ENTRYPOINT ["ucam-faas", "--target"]