-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# =============================================================================
# Google Ads Agent — Dockerfile
# Multi-stage build: slim Python image with all dependencies
# =============================================================================
FROM python:3.12-slim AS base
# Prevent Python from writing .pyc files and enable unbuffered output
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# ── Dependencies ──────────────────────────────────────────────────────────────
FROM base AS deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ── Application ───────────────────────────────────────────────────────────────
FROM deps AS app
# Copy everything
COPY . .
# Expose the API port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD python -c "import httpx; r = httpx.get('http://localhost:8000/health'); assert r.status_code == 200"
# Default: run the FastAPI server
CMD ["uvicorn", "deploy.server:app", "--host", "0.0.0.0", "--port", "8000"]