Files
thoughts/compose.yml
Gabriel Kaszewski 0b74344efe
Some checks failed
test / unit (push) Has been cancelled
lint / lint (push) Has been cancelled
docs: fix DX for new contributors
- Fix port mismatch: Dockerfile EXPOSE 8000, .env.example PORT=8000,
  compose.yml gets explicit PORT=8000
- Add thoughts-frontend/.env.example with all required vars
- Document NEXT_PUBLIC_FEDIVERSE_DOMAIN in README
- Document private cargo registry (k-ap on Gitea)
- Add local dev workflow: make dev-infra → cargo run → bun dev
- Split make targets: test-unit (no DB), test-integration, up
2026-05-29 14:27:42 +02:00

74 lines
1.6 KiB
YAML

services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: thoughts
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
nats:
image: nats:2-alpine
ports:
- "4222:4222"
- "8222:8222" # monitoring endpoint
command: ["--jetstream", "--http_port", "8222"]
api:
build: .
ports:
- "8000:8000"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts
JWT_SECRET: change-me-in-production
BASE_URL: http://localhost:8000
PORT: 8000
NATS_URL: nats://nats:4222
RUST_LOG: info
STORAGE_BACKEND: local
STORAGE_PATH: /data/media
volumes:
- media_data:/data/media
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_started
worker:
build: .
entrypoint: ["./thoughts-worker"]
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/thoughts
BASE_URL: http://localhost:8000
NATS_URL: nats://nats:4222
RUST_LOG: info
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_started
frontend:
build:
context: ./thoughts-frontend
args:
NEXT_PUBLIC_API_URL: http://localhost:8000
NEXT_PUBLIC_SERVER_SIDE_API_URL: http://api:8000
ports:
- "3000:3000"
depends_on:
- api
volumes:
postgres_data:
media_data: