39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:22-alpine AS frontend-build
|
|
|
|
WORKDIR /build/frontend
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
|
|
FROM python:3.14-slim AS runtime
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN groupadd --gid 10001 app \
|
|
&& useradd --uid 10001 --gid app --create-home --home-dir /home/app app \
|
|
&& mkdir -p /app/config /app/data /app/frontend \
|
|
&& chown -R app:app /app /home/app
|
|
|
|
COPY requirements.txt ./
|
|
RUN python -m pip install --no-cache-dir --requirement requirements.txt
|
|
|
|
COPY --chown=app:app backend/ ./backend/
|
|
COPY --from=frontend-build --chown=app:app /build/frontend/dist/ ./frontend/dist/
|
|
|
|
USER app
|
|
|
|
EXPOSE 8000
|
|
VOLUME ["/app/data"]
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health/ready', timeout=4).close()"]
|
|
|
|
CMD ["python", "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--timeout-graceful-shutdown", "180"]
|