95 lines
2.2 KiB
YAML
95 lines
2.2 KiB
YAML
|
|
version: '3.8'
|
||
|
|
|
||
|
|
services:
|
||
|
|
db:
|
||
|
|
image: postgres:14-alpine
|
||
|
|
container_name: funmc-db
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: postgres
|
||
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-funmc_password}
|
||
|
|
POSTGRES_DB: funmc
|
||
|
|
volumes:
|
||
|
|
- postgres_data:/var/lib/postgresql/data
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
networks:
|
||
|
|
- funmc-network
|
||
|
|
|
||
|
|
server:
|
||
|
|
build:
|
||
|
|
context: ..
|
||
|
|
dockerfile: docker/Dockerfile.server
|
||
|
|
container_name: funmc-server
|
||
|
|
restart: unless-stopped
|
||
|
|
depends_on:
|
||
|
|
db:
|
||
|
|
condition: service_healthy
|
||
|
|
environment:
|
||
|
|
DATABASE_URL: postgres://postgres:${DB_PASSWORD:-funmc_password}@db/funmc
|
||
|
|
JWT_SECRET: ${JWT_SECRET:-your-secret-key-change-in-production}
|
||
|
|
LISTEN_ADDR: 0.0.0.0:3000
|
||
|
|
RUST_LOG: funmc_server=info,tower_http=info
|
||
|
|
ports:
|
||
|
|
- "3000:3000"
|
||
|
|
- "3001:3001/udp"
|
||
|
|
networks:
|
||
|
|
- funmc-network
|
||
|
|
|
||
|
|
relay:
|
||
|
|
build:
|
||
|
|
context: ..
|
||
|
|
dockerfile: docker/Dockerfile.relay
|
||
|
|
container_name: funmc-relay
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
RELAY_LISTEN_ADDR: 0.0.0.0:7900
|
||
|
|
JWT_SECRET: ${JWT_SECRET:-your-secret-key-change-in-production}
|
||
|
|
RUST_LOG: funmc_relay_server=info
|
||
|
|
ports:
|
||
|
|
- "7900:7900/udp"
|
||
|
|
- "17900:17900/udp"
|
||
|
|
networks:
|
||
|
|
- funmc-network
|
||
|
|
|
||
|
|
relay-backup:
|
||
|
|
build:
|
||
|
|
context: ..
|
||
|
|
dockerfile: docker/Dockerfile.relay
|
||
|
|
container_name: funmc-relay-backup
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
RELAY_LISTEN_ADDR: 0.0.0.0:7901
|
||
|
|
JWT_SECRET: ${JWT_SECRET:-your-secret-key-change-in-production}
|
||
|
|
RUST_LOG: funmc_relay_server=info
|
||
|
|
ports:
|
||
|
|
- "7901:7901/udp"
|
||
|
|
- "17901:17901/udp"
|
||
|
|
networks:
|
||
|
|
- funmc-network
|
||
|
|
|
||
|
|
nginx:
|
||
|
|
image: nginx:alpine
|
||
|
|
container_name: funmc-nginx
|
||
|
|
restart: unless-stopped
|
||
|
|
depends_on:
|
||
|
|
- server
|
||
|
|
ports:
|
||
|
|
- "80:80"
|
||
|
|
- "443:443"
|
||
|
|
volumes:
|
||
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||
|
|
- ./ssl:/etc/nginx/ssl:ro
|
||
|
|
networks:
|
||
|
|
- funmc-network
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres_data:
|
||
|
|
|
||
|
|
networks:
|
||
|
|
funmc-network:
|
||
|
|
driver: bridge
|