services: db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: tern POSTGRES_PASSWORD: tern POSTGRES_DB: tern volumes: - db-data:/var/lib/postgresql/data ports: - "127.0.0.1:5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U tern"] interval: 5s timeout: 5s retries: 10 server: build: . restart: unless-stopped depends_on: db: condition: service_healthy environment: DATABASE_URL: postgres://tern:tern@db:5432/tern BIND_ADDR: 0.0.0.0:8080 CREDENTIAL_KEY: ${CREDENTIAL_KEY} BLOB_STORAGE_DIR: /data/blobs RUST_LOG: tern_server=info volumes: - blob-data:/data/blobs # Not published directly — nginx is the only thing that should be # reachable from outside (server-architecture-spec.md §7). expose: - "8080" nginx: image: nginx:alpine restart: unless-stopped depends_on: - server ports: - "80:80" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro volumes: db-data: blob-data: