From ab717e798d1d15c9cbedcd92684396e5f3a8e315 Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 16 Dec 2024 19:41:16 +0100 Subject: [PATCH] Container: add containerfiles --- Containerfile | 19 +++++++++++++++++++ Containerfile.deps | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Containerfile create mode 100644 Containerfile.deps diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..18b0cfb --- /dev/null +++ b/Containerfile @@ -0,0 +1,19 @@ +# Build: podman build -t code.philo.ydns.eu/philorg/gisaf-backend -f Containerfile + +FROM code.philo.ydns.eu/philorg/gisaf-backend-deps + +ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages +ENV GISAF__BACKEND__PORT 8898 +ENV GISAF__BACKEND__BIND__ADDR 0.0.0.0 +ARG APP_VERSION=0.0.0 + +COPY . /src + +RUN uv pip install \ + --python=$UV_PROJECT_ENVIRONMENT \ + --no-deps \ + /src + +RUN echo $APP_VERSION > /app/version.txt + +CMD uvicorn gisaf.application:app --port ${GISAF__BACKEND__PORT} --host ${GISAF__BACKEND__BIND__ADDR} diff --git a/Containerfile.deps b/Containerfile.deps new file mode 100644 index 0000000..515e915 --- /dev/null +++ b/Containerfile.deps @@ -0,0 +1,10 @@ +# Build: podman build -t code.philo.ydns.eu/philorg/gisaf-backend-deps -f Containerfile.deps + +FROM code.philo.ydns.eu/philorg/trixie_python + +COPY ./pyproject.toml ./README.md ./uv.lock /_lock/ + +RUN --mount=type=cache,target=/root/.cache <