Files
test_task_crm/migrations/Dockerfile
T
k1nq 0e48023258
Build and deploy / build (push) Successful in 20s
Build and deploy / deploy (push) Successful in 15s
fix: add migrations service to docker-compose and update build workflow for migrations image
2025-11-30 00:18:19 +05:00

26 lines
602 B
Docker

# syntax=docker/dockerfile:1.7
FROM ghcr.io/astral-sh/uv:python3.14-alpine AS builder
WORKDIR /opt/migrations
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
COPY app ./app
COPY migrations ./migrations
COPY alembic.ini .
FROM python:3.14-alpine AS runtime
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
ENV PATH="/opt/app/.venv/bin:${PATH}"
WORKDIR /opt/app
RUN apk add --no-cache postgresql-libs
COPY --from=builder /opt/migrations/.venv /opt/app/.venv
COPY app ./app
COPY migrations ./migrations
COPY alembic.ini .
COPY pyproject.toml .
ENTRYPOINT ["alembic", "upgrade", "head"]