diff --git a/.containerignore b/.containerignore index 5724d4f..15697f7 100644 --- a/.containerignore +++ b/.containerignore @@ -1,5 +1,4 @@ .venv -.git dist .pytest_cache .forgejo diff --git a/Containerfile b/Containerfile index ee769f8..ff60531 100644 --- a/Containerfile +++ b/Containerfile @@ -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", \