write/docker-compose.yml
chris 635f56e44b Fix service DNS by using explicit named network
network_mode: bridge uses Docker's default bridge which has no
service-name DNS. An explicit named network gets its own resolver
so nginx can resolve "server" by name. Also adds a healthcheck so
app waits until server is actually ready before nginx starts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:59:53 -04:00

42 lines
990 B
YAML

services:
server:
build: ./server
restart: unless-stopped
volumes:
- ./server_data:/app/data
- ./server_uploads:/app/uploads
environment:
- JWT_SECRET=${JWT_SECRET:-change-me-in-production}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- OLLAMA_URL=${OLLAMA_URL:-https://ai.binarygnome.com}
- OLLAMA_MODEL=${OLLAMA_MODEL:-gemma4:latest}
extra_hosts:
- "host-gateway:host-gateway"
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "node -e \"require('net').createConnection(3000).on('connect',()=>process.exit(0)).on('error',()=>process.exit(1))\""]
interval: 5s
timeout: 3s
retries: 10
start_period: 15s
app:
build: ./frontend
restart: unless-stopped
depends_on:
server:
condition: service_healthy
networks:
- internal
ports:
- "127.0.0.1:3080:80"
networks:
internal:
driver: bridge
volumes:
server_data:
server_uploads: