- add backend entrypoint that can run alembic upgrade head on startup - add RUN_MIGRATIONS_ON_STARTUP setting and compose wiring - add /health/live and /health/ready endpoints with db+redis checks - add backend container healthcheck against readiness endpoint - document readiness and startup migration behavior
18 lines
401 B
Docker
18 lines
401 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
RUN chmod +x /app/docker/backend-entrypoint.sh
|
|
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["/app/docker/backend-entrypoint.sh"]
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|