add docker setup

This commit is contained in:
dreamer committed 2026-10-14 15:05:56 +02:00
1 parent e0cb73e57a
commit 95844407bb
3 files changed
+58 -1

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
FROM python:3.14-slim AS builder
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true
RUN pip install --upgrade pip
RUN pip install poetry
WORKDIR /app
COPY poetry.lock pyproject.toml ./
RUN poetry install --only main --no-root
FROM python:3.14-slim AS runtime
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
RUN adduser --disabled-password --gecos "" appuser
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/pyproject.toml /app/poetry.lock ./
COPY . /app
RUN mkdir -p /data && chown appuser:appuser /data
ENV PATH="/app/.venv/bin:$PATH"
USER appuser
EXPOSE 8000
CMD ["uvicorn", "fdhview.main:app", "--host", "0.0.0.0", "--port", "8000"]