Skip to content

Commit c04d131

Browse files
committed
phase 8: fix python 3.12 compat, healthchecks, nginx BOM, lockfile regen
1 parent b94cc2e commit c04d131

4 files changed

Lines changed: 1331 additions & 23 deletions

File tree

backend/Dockerfile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
1-
# ── Stage 1: dependency installer ──────────────────────────────────────────
1+
# Stage 1: dependency installer
22
FROM python:3.12-slim AS builder
33

4-
# Install uv (fast Python package installer)
54
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
65

76
WORKDIR /app
87

9-
# Copy only dependency files first — this layer is cached until they change
108
COPY pyproject.toml uv.lock ./
119

12-
# Install dependencies into a venv inside /app/.venv
13-
# --frozen: use exact versions from uv.lock
14-
# --no-dev: skip pytest, ruff — not needed at runtime
15-
RUN uv sync --frozen --no-dev
10+
# Force uv to use the system Python 3.12 instead of downloading 3.14
11+
RUN uv sync --frozen --no-dev --python /usr/local/bin/python3
1612

17-
# ── Stage 2: runtime image ─────────────────────────────────────────────────
13+
# Stage 2: runtime image
1814
FROM python:3.12-slim AS runtime
1915

2016
WORKDIR /app
2117

22-
# Copy the installed venv from builder
2318
COPY --from=builder /app/.venv /app/.venv
2419

25-
# Copy application source
2620
COPY backend/ ./backend/
2721

28-
# Make the venv's Python the default
2922
ENV PATH="/app/.venv/bin:$PATH"
3023

31-
# Create uploads directory (volume will be mounted here in compose)
3224
RUN mkdir -p /app/uploads
3325

34-
# Expose the port uvicorn will listen on
3526
EXPOSE 8000
3627

37-
# Run uvicorn in production mode
38-
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
28+
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]

docker-compose.prod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
volumes:
3535
- qdrant_data:/qdrant/storage
3636
healthcheck:
37-
test: ["CMD-SHELL", "curl -f http://localhost:6333/healthz || exit 1"]
37+
test: ["CMD-SHELL", "timeout 1 bash -c 'cat < /dev/null > /dev/tcp/localhost/6333' || exit 1"]
3838
interval: 10s
3939
timeout: 5s
4040
retries: 5
@@ -70,7 +70,7 @@
7070
qdrant:
7171
condition: service_healthy
7272
healthcheck:
73-
test: ["CMD-SHELL", "curl -f http://localhost:8000/health/live || exit 1"]
73+
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health/live')\" || exit 1"]
7474
interval: 15s
7575
timeout: 5s
7676
retries: 5

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
[project]
1+
[project]
22
name = "eada"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = ">=3.14"
6+
requires-python = ">=3.12"
77
dependencies = [
88
"alembic>=1.18.5",
99
"argon2-cffi>=25.1.0",
1010
"asyncpg>=0.31.0",
1111
"duckdb>=1.5.4",
1212
"fastapi>=0.138.1",
1313
"langfuse==2.60.0",
14+
"langgraph>=1.2.2",
1415
"litellm>=1.90.0",
1516
"openpyxl>=3.1.5",
1617
"pandas>=3.0.3",

0 commit comments

Comments
 (0)