Set up MongoDB
Two ways to get one: the mongo service already in
docker-compose.yml, nothing else to install — or
an external instance like
MongoDB Atlas. Create a database there, copy its connection string into
MONGO_URI, and you're done.
Using Atlas with Docker? Drop the mongo service and
its MONGO_URI override from
docker-compose.yml. Deploying to
Vercel instead? Fork the repo, import it there,
and point MONGO_URI at Atlas — same environment
variables, no server or container to manage.
services:
comments:
image: ghcr.io/byandrev/hilo:latest
ports: ["8000:8000"]
env_file: .env
environment:
MONGO_URI: mongodb://mongo:27017
depends_on: [mongo]
restart: unless-stopped
mongo:
image: mongo:7
volumes: ["./data:/data/db"]
restart: unless-stopped
MONGO_URI=mongodb+srv://user:pass@cluster.mongodb.net
MONGO_DB=hilo