@@ -61,19 +61,22 @@ FROM base_builder AS http_builder
61
61
RUN --mount=type=cache,target=~/.cache/uv \
62
62
uv sync --no-dev --group http --no-install-project --frozen --no-editable
63
63
64
- # Installs requirements to run production http application
64
+ # Installs requirements to run production socketio application
65
65
FROM base_builder AS socketio_builder
66
66
RUN --mount=type=cache,target=~/.cache/uv \
67
67
uv sync --no-dev --group socketio --no-install-project --frozen --no-editable
68
68
69
+ # Installs requirements to run production migrations application
70
+ FROM base_builder AS migrations_builder
71
+ RUN --mount=type=cache,target=~/.cache/uv \
72
+ uv sync --no-dev --group migrations --no-install-project --frozen --no-editable
73
+
69
74
# Create the base app with the common python packages
70
75
FROM base AS base_app
71
76
USER nonroot
72
77
COPY --chown=nonroot:nonroot src/common ./common
73
78
COPY --chown=nonroot:nonroot src/domains ./domains
74
79
COPY --chown=nonroot:nonroot src/gateways ./gateways
75
- COPY --chown=nonroot:nonroot src/migrations ./migrations
76
- COPY --chown=nonroot:nonroot src/alembic.ini .
77
80
78
81
# Copy the http python package and requirements from relevant builder
79
82
FROM base_app AS http
@@ -89,6 +92,14 @@ COPY --chown=nonroot:nonroot src/socketio_app ./socketio_app
89
92
# Run CMD using array syntax, so it uses `exec` and runs as PID1
90
93
CMD ["python" , "-m" , "socketio_app" ]
91
94
95
+ # Copy the socketio python package and requirements from relevant builder
96
+ FROM base_app AS migrations
97
+ COPY --from=migrations_builder /venv /venv
98
+ COPY --chown=nonroot:nonroot src/migrations ./migrations
99
+ COPY --chown=nonroot:nonroot src/alembic.ini .
100
+ # Run CMD using array syntax, so it uses `exec` and runs as PID1
101
+ CMD ["alembic" , "upgrade" , "heads" ]
102
+
92
103
# Copy the dramatiq python package and requirements from relevant builder
93
104
FROM base_app AS dramatiq
94
105
COPY --from=dramatiq_builder /venv /venv
0 commit comments