INITIAL COMMIT
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM ghcr.io/astral-sh/uv:0.11.16 AS uv-bin
|
||||
|
||||
FROM python:3.12-slim AS runtime
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONPATH=/app/src \
|
||||
DATA_DIR=/data \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
COPY --from=uv-bin /uv /usr/local/bin/uv
|
||||
COPY pyproject.toml uv.lock* ./
|
||||
RUN if [ -f uv.lock ]; then uv sync --frozen --no-dev; else uv sync --no-dev; fi
|
||||
|
||||
COPY src/ ./src/
|
||||
COPY templates/ ./templates/
|
||||
COPY static/ ./static/
|
||||
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 8000
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3)"
|
||||
|
||||
CMD ["uvicorn", "garmin_coach_clone.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user