CI: build container from plain Python image
All checks were successful
/ test (push) Successful in 25s
/ build (push) Successful in 27s

This commit is contained in:
phil 2025-03-16 14:14:39 +01:00
parent ea7e3087cd
commit 7105edecd1
2 changed files with 6 additions and 16 deletions

View file

@ -1,5 +1,4 @@
.venv
.git
dist
.pytest_cache
.forgejo

View file

@ -1,22 +1,13 @@
# Build: podman build -t code.philo.ydns.eu/philorg/treetrail-backend -f Containerfile
FROM docker.io/library/python:latest
FROM code.philo.ydns.eu/philorg/treetrail-backend-deps
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages
ARG APP_VERSION=0.0.0
COPY . /app
COPY . /src
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /app
#RUN --mount=type=cache,target=/root/.cache \
# cd /src && \
# uv sync --locked --no-dev --no-editable
RUN uv pip install \
--python=$UV_PROJECT_ENVIRONMENT \
--no-deps \
/src
RUN echo $APP_VERSION > /app/version.txt
RUN uv pip install --system .
CMD [ \
"uvicorn", "treetrail.application:app", \