2025-01-11 11:58:05 -08:00
|
|
|
FROM python:3 AS build
|
2025-01-11 10:33:13 -08:00
|
|
|
|
2025-01-11 11:58:05 -08:00
|
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
2025-01-11 10:33:13 -08:00
|
|
|
|
2025-01-11 11:58:05 -08:00
|
|
|
WORKDIR /app
|
|
|
|
RUN uv venv
|
2025-01-11 10:33:13 -08:00
|
|
|
|
|
|
|
COPY requirements.txt .
|
2025-01-11 11:58:05 -08:00
|
|
|
RUN uv pip install --system -r requirements.txt
|
2025-01-11 10:33:13 -08:00
|
|
|
|
2025-01-11 11:58:05 -08:00
|
|
|
# Copy the project into the intermediate image
|
|
|
|
ADD . /app
|
|
|
|
|
|
|
|
FROM python:3-slim
|
|
|
|
# Copy the environment, but not the source code
|
|
|
|
COPY --from=build --chown=app:app /app/.venv /app/.venv
|
2025-01-11 10:33:13 -08:00
|
|
|
|
|
|
|
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
|
|
|
|
USER appuser
|
|
|
|
|
2025-01-11 11:58:05 -08:00
|
|
|
CMD ["python", "scl.py"]
|