Deploying to a public URL
Containerize the app and deploy it to a platform like Render, Railway, or Fly.io — live on the internet.
The starter kit ships a Dockerfile that packages the whole app — Python deps, semantic layer, and even the database (it regenerates it at build time). A container means "works on my machine" becomes "works anywhere," which is exactly what a host needs.
FROM python:3.11-slim
WORKDIR /srv
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN python data/generate_data.py # build the DB into the image
ENV PORT=8000
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT}"]Deploy on a managed platform
Platforms like Render, Railway, and Fly.io deploy a container from a git repo with almost no config. The flow is the same everywhere:
First, put the code on GitHub
- 1From the
semantic-agent/folder:git init(skip if it's already a git repo), thengit add .andgit commit -m "Percolate analytics agent". - 2On github.com, click + → New repository, name it (e.g.
percolate-agent), and create it empty — no README, since you're pushing an existing project. - 3Connect and push:
git remote add origin <your-repo-url>thengit push -u origin main.
Push the semantic-agent/ folder itself as the repository — not the whole course folder with semantic-agent/ nested inside. Platforms look for a Dockerfile at the repo root; if it's buried a level down, the build won't start.
Then create the service
- 1Create a new Web Service on the platform and point it at the repo. It detects the Dockerfile.
- 2Add
ANTHROPIC_API_KEYas a secret environment variable in the platform's dashboard. - 3Deploy. The platform builds the image, runs it, and gives you a public HTTPS URL like
https://percolate-agent.onrender.com. - 4Open the URL and ask your data a question — from anywhere.
All three platforms have free or low-cost tiers that comfortably run a demo app like this. Your ongoing cost is mostly the Anthropic API usage — a few cents per question. A shared portfolio project costs very little to keep online, and you can switch the MODEL constant to a smaller model if traffic ever makes it add up.
Because the database is baked into the image, it's perfect for this analytical, read-only app. If you later needed the app to write persistent data, you'd move to a hosted database — but for querying fabricated business data, the in-image SQLite is ideal.