Add Gitea container workflow and modernize build process with uv
Build and Push Podman Container / build-and-push (push) Canceled after 0s

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-08-14 20:40:19 +02:00
co-authored by Junie
parent a46332245f
commit f3b9fa133a
7 changed files with 529 additions and 56 deletions
+45
View File
@@ -0,0 +1,45 @@
# Use a Python image with uv pre-installed
FROM ghcr.io/astral-sh/uv:python3.12-alpine AS builder
# Set the working directory
WORKDIR /app
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy from the cache instead of linking
ENV UV_LINK_MODE=copy
# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --no-dev
# Final image
FROM python:3.12-alpine
# Create a non-privileged user
RUN adduser --disabled-password --gecos "" appuser
WORKDIR /app
# Copy the virtualenv from the builder
COPY --from=builder --chown=appuser:appuser /app/.venv /app/.venv
# Set environment variables
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DJANGO_ALLOWED_HOSTS=*
# Copy the application code
COPY --chown=appuser:appuser . .
# Switch to the non-privileged user
USER appuser
# Run the Django app
# The Django project root is at /app/isotables/
WORKDIR /app/isotables
EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]