Skip to content

Commit f823acf

Browse files
rustyconoverclaude
andcommitted
Add Fly.io deployment for the HTTP worker
Dockerfile builds the vgi-easter-http server (uv, python 3.13-slim) listening on :8080; fly.toml deploys it to iad with scale-to-zero. VGI_SIGNING_KEY is a Fly secret. Deployed at https://vgi-easter-python.fly.dev. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 91d1e9e commit f823acf

3 files changed

Lines changed: 62 additions & 0 deletions

File tree

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.git
2+
.github
3+
.venv
4+
dist
5+
htmlcov
6+
assets
7+
ci
8+
tests
9+
test
10+
__pycache__
11+
*.pyc
12+
.mypy_cache
13+
.pytest_cache
14+
.ruff_cache
15+
.DS_Store
16+
fly.toml

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2026 Query Farm LLC - https://query.farm
2+
#
3+
# Container for the easter VGI worker's HTTP transport (`vgi-easter-http`).
4+
# DuckDB clients ATTACH it over http:// — see README.
5+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
6+
7+
WORKDIR /app
8+
ENV UV_COMPILE_BYTECODE=1 \
9+
UV_LINK_MODE=copy
10+
11+
# Install dependencies first (cached layer), then the project itself.
12+
COPY pyproject.toml uv.lock ./
13+
RUN uv sync --frozen --no-dev --no-install-project
14+
15+
COPY README.md LICENSE easter_worker.py serve.py ./
16+
RUN uv sync --frozen --no-dev
17+
18+
ENV PATH="/app/.venv/bin:$PATH"
19+
20+
# Fly routes external traffic to this internal port (see fly.toml).
21+
EXPOSE 8080
22+
CMD ["vgi-easter-http", "--host", "0.0.0.0", "--port", "8080", "--log-format", "json"]

fly.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 Query Farm LLC - https://query.farm
2+
#
3+
# Fly.io deployment for the easter VGI worker's HTTP transport. DuckDB clients
4+
# attach it over https://vgi-easter-python.fly.dev — e.g.
5+
# INSTALL vgi FROM community; LOAD vgi;
6+
# ATTACH 'easter' (TYPE 'vgi', LOCATION 'https://vgi-easter-python.fly.dev');
7+
#
8+
# VGI_SIGNING_KEY is provided as a Fly secret (set via `fly secrets set`).
9+
app = "vgi-easter-python"
10+
primary_region = "iad"
11+
12+
[build]
13+
14+
[http_service]
15+
internal_port = 8080
16+
force_https = true
17+
# Scale to zero: stop when idle, auto-start on the next request.
18+
auto_stop_machines = "stop"
19+
auto_start_machines = true
20+
min_machines_running = 0
21+
22+
[[vm]]
23+
size = "shared-cpu-1x"
24+
memory = "512mb"

0 commit comments

Comments
 (0)