Skip to content

Commit c23a0ef

Browse files
committed
docker base img for all support containers, and updated all other stuff
1 parent f4ebcb6 commit c23a0ef

File tree

11 files changed

+86
-206
lines changed

11 files changed

+86
-206
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
run: |
6161
echo "Pre-pulling base images to speed up builds..."
6262
docker pull python:3.12-slim &
63+
docker pull ghcr.io/astral-sh/uv:0.9.17 &
6364
docker pull alpine:latest &
6465
docker pull confluentinc/cp-kafka:7.5.0 &
6566
docker pull confluentinc/cp-zookeeper:7.5.0 &

backend/Dockerfile

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1-
FROM python:3.12-slim
2-
WORKDIR /app
3-
4-
# Install required packages
5-
RUN apt-get update && apt-get install -y \
6-
gcc \
7-
libsnappy-dev \
8-
liblzma-dev \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies (production only, no dev deps)
18-
# --no-install-project: don't install project itself, only dependencies (source dirs don't exist yet)
19-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Backend API service
2+
FROM base
203

214
# Copy application files and configuration
225
COPY ./app /app/app
@@ -28,9 +11,6 @@ COPY openssl.cnf /app/openssl.cnf
2811
# Ensure the certs directory exists
2912
RUN mkdir -p /app/certs
3013

31-
# Set Python path so imports work without installing project as package
32-
ENV PYTHONPATH=/app
33-
3414
# Expose metrics port
3515
EXPOSE 9090
3616

backend/Dockerfile.base

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Shared base image for all backend services
2+
# Contains: Python, system deps, uv, and all Python dependencies
3+
FROM python:3.12-slim
4+
5+
WORKDIR /app
6+
7+
# Install all system dependencies needed by any service
8+
RUN apt-get update && apt-get install -y \
9+
gcc \
10+
curl \
11+
libsnappy-dev \
12+
liblzma-dev \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Install uv
16+
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
17+
18+
# Copy dependency files
19+
COPY pyproject.toml uv.lock ./
20+
21+
# Install Python dependencies (production only)
22+
# --no-install-project: don't install project itself, only dependencies
23+
RUN uv sync --frozen --no-dev --no-install-project
24+
25+
# Set Python path so imports work
26+
ENV PYTHONPATH=/app
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
FROM python:3.12-slim
2-
3-
WORKDIR /app
4-
5-
# Install system dependencies
6-
RUN apt-get update && apt-get install -y \
7-
gcc \
8-
curl \
9-
libsnappy-dev \
10-
&& rm -rf /var/lib/apt/lists/*
11-
12-
# Install uv
13-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
14-
15-
# Copy dependency files
16-
COPY pyproject.toml uv.lock ./
17-
18-
# Install Python dependencies
19-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Coordinator worker
2+
FROM base
203

214
# Copy application code
225
COPY . .
236

24-
# Set Python path
25-
ENV PYTHONPATH=/app
26-
277
# Run the coordinator service
288
CMD ["uv", "run", "python", "-m", "workers.run_coordinator"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for DLQ Processor
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# DLQ Processor worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run DLQ processor
338
CMD ["uv", "run", "python", "workers/dlq_processor.py"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for Event Replay worker
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Event Replay worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run event replay service
338
CMD ["uv", "run", "python", "workers/run_event_replay.py"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for KubernetesWorker
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Kubernetes Worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run Kubernetes worker
338
CMD ["uv", "run", "python", "workers/run_k8s_worker.py"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for PodMonitor worker
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Pod Monitor worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run pod monitor
338
CMD ["uv", "run", "python", "workers/run_pod_monitor.py"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for ResultProcessor worker
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Result Processor worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run result processor
338
CMD ["uv", "run", "python", "workers/run_result_processor.py"]
Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
# Dockerfile for Saga Orchestrator worker
2-
FROM python:3.12-slim
3-
4-
WORKDIR /app
5-
6-
# Install system dependencies
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
10-
11-
# Install uv
12-
COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
13-
14-
# Copy dependency files
15-
COPY pyproject.toml uv.lock ./
16-
17-
# Install Python dependencies
18-
RUN uv sync --frozen --no-dev --no-install-project
1+
# Saga Orchestrator worker
2+
FROM base
193

204
# Copy application code
215
COPY . .
226

23-
# Set Python path
24-
ENV PYTHONPATH=/app
25-
26-
# Create non-root user
27-
RUN useradd -m -u 1000 worker && \
28-
chown -R worker:worker /app
29-
30-
USER worker
31-
327
# Run saga orchestrator
338
CMD ["uv", "run", "python", "workers/run_saga_orchestrator.py"]

0 commit comments

Comments
 (0)