-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.fly
More file actions
38 lines (28 loc) · 1.02 KB
/
Dockerfile.fly
File metadata and controls
38 lines (28 loc) · 1.02 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
# Fly.io production Dockerfile — backend API/worker only.
# Frontend is deployed separately on Cloudflare Pages.
# Build context: project root (where fly.toml lives).
FROM python:3.12-slim
# System dependencies (GDAL for rasterio/GeoAlchemy2, curl for healthchecks)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
libgdal-dev \
libproj-dev \
proj-bin \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies first (layer-cache friendly)
COPY backend/pyproject.toml .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir .
# Copy backend source
COPY backend/ .
# Copy seed/maintenance scripts (run manually via `fly ssh console`)
COPY scripts/ /app/scripts/
# Entrypoint runs migrations then starts the app
RUN chmod +x /app/entrypoint.sh && cp /app/entrypoint.sh /entrypoint.sh
ENV PYTHONPATH=/app
EXPOSE 8000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]