Add a Containerfile
Some checks failed
ci/woodpecker/push/check Pipeline failed

This commit is contained in:
PapaTutuWawa 2025-04-21 16:15:34 +02:00
parent f55542cf18
commit 899d90424e
2 changed files with 28 additions and 0 deletions

9
.dockerignore Normal file
View File

@ -0,0 +1,9 @@
prosody/
config.yaml
db.sqlite3
prosody.cfg.lua
.woodpecker/
.ruff_cache/
.venv/
.ropeproject/
.mypy_cache/

19
Containerfile Normal file
View File

@ -0,0 +1,19 @@
FROM ghcr.io/astral-sh/uv:python3.13-alpine as builder
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0
WORKDIR /app
ADD . /app
RUN apk add --no-cache cargo git && \
uv sync --frozen --no-install-project --no-dev
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
FROM python:3.13-alpine3.20
# slixmpp requires libgcc
RUN apk add --no-cache libgcc
# Install the application
COPY --from=builder /app /app
WORKDIR /app
ENV PATH="/app/.venv/bin:$PATH"
CMD ["/app/.venv/bin/fastapi", "run", "src/xmpp_api/main.py", "--port", "8080"]