sass-imobiliaria/backend/Dockerfile.prod
MatheusAlves96 dcd18a07e6
Some checks are pending
CI/CD → Portainer / Build & Push Docker Images (push) Waiting to run
CI/CD → Portainer / Deploy to Portainer (push) Blocked by required conditions
CI/CD → Portainer / Validate HTTPS & Endpoints (push) Blocked by required conditions
ci: add forgejo actions pipeline with traefik labels and https health checks
2026-04-21 00:06:22 -03:00

34 lines
904 B
Text

FROM python:3.12-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir uv
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --no-dev --frozen
COPY . .
# ── Runtime ──────────────────────────────────────────────────────────────────
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev curl \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir uv
WORKDIR /app
COPY --from=builder /app /app
RUN chmod +x entrypoint.sh
EXPOSE 5000
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \
CMD curl -f http://localhost:5000/health || exit 1
ENTRYPOINT ["./entrypoint.sh"]