Use dynamic versioning

This commit is contained in:
phil 2025-03-16 19:02:10 +01:00
parent d54bb178dd
commit a3a2efe471
5 changed files with 85 additions and 68 deletions

View file

@ -1,19 +1,17 @@
# Build: podman build -t code.philo.ydns.eu/philorg/gisaf-backend -f Containerfile
FROM code.philo.ydns.eu/philorg/gisaf-backend-deps
FROM docker.io/library/python:latest
ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
ENV GISAF__BACKEND__PORT 8898
ENV GISAF__BACKEND__BIND__ADDR 0.0.0.0
ARG APP_VERSION=0.0.0
COPY . /src
COPY . /app
RUN uv pip install \
--python=$UV_PROJECT_ENVIRONMENT \
--no-deps \
/src
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /app
RUN uv pip install --system .
RUN echo $APP_VERSION > /app/version.txt
CMD uvicorn gisaf.application:app --port ${GISAF__BACKEND__PORT} --host ${GISAF__BACKEND__BIND__ADDR}