142 lines
4.1 KiB
YAML
142 lines
4.1 KiB
YAML
version: '3.8'
|
|
|
|
# Gemini Parallel Deployment
|
|
# Ports shifted to avoid conflict with production
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: mtad-postgres-gemini
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: admin
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-gemini-test-password}
|
|
POSTGRES_DB: morethanadiagnosis
|
|
volumes:
|
|
- postgres_data_gemini:/var/lib/postgresql/data
|
|
ports:
|
|
- "5433:5432"
|
|
networks:
|
|
- mtad-network-gemini
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -U admin -d morethanadiagnosis" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: mtad-redis-gemini
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6380:6379"
|
|
volumes:
|
|
- redis_data_gemini:/data
|
|
networks:
|
|
- mtad-network-gemini
|
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-gemini-test-password}
|
|
healthcheck:
|
|
test: [ "CMD", "redis-cli", "ping" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: mtad-api-gemini
|
|
restart: unless-stopped
|
|
environment:
|
|
ENV: development
|
|
DEBUG: "true"
|
|
DATABASE_URL: postgresql://admin:${DB_PASSWORD:-gemini-test-password}@postgres:5432/morethanadiagnosis
|
|
REDIS_URL: redis://:${REDIS_PASSWORD:-gemini-test-password}@redis:6379/0
|
|
SECRET_KEY: ${SECRET_KEY:-gemini-test-secret}
|
|
CORS_ORIGINS: '["http://localhost:3001", "http://localhost:8081", "http://216.158.230.94:8081", "https://mtd.runfoo.run", "https://www.mtd.runfoo.run"]'
|
|
LOG_LEVEL: DEBUG
|
|
DISCOURSE_URL: https://forum.mtd.runfoo.run
|
|
DISCOURSE_SSO_SECRET: gemini-test-sso-secret
|
|
ports:
|
|
- "8001:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- mtad-network-gemini
|
|
- traefik
|
|
volumes:
|
|
- ./app:/app/app:ro
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.mtad-api.rule=Host(`mtd.runfoo.run`) && (PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`) || PathPrefix(`/openapi.json`))"
|
|
- "traefik.http.routers.mtad-api.entrypoints=websecure"
|
|
- "traefik.http.routers.mtad-api.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.mtad-api.loadbalancer.server.port=8000"
|
|
|
|
frontend:
|
|
build:
|
|
context: ../web
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NEXT_PUBLIC_API_BASE_URL: https://mtd.runfoo.run/api/v1
|
|
container_name: mtad-web-gemini
|
|
restart: unless-stopped
|
|
expose:
|
|
- "3000"
|
|
networks:
|
|
- mtad-network-gemini
|
|
- traefik
|
|
depends_on:
|
|
- api
|
|
environment:
|
|
NEXT_PUBLIC_API_BASE_URL: https://mtd.runfoo.run/api/v1
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.mtad-frontend.rule=Host(`mtd.runfoo.run`) || Host(`www.mtd.runfoo.run`)"
|
|
- "traefik.http.routers.mtad-frontend.entrypoints=websecure"
|
|
- "traefik.http.routers.mtad-frontend.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.mtad-frontend.loadbalancer.server.port=3000"
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: mtad-nginx-gemini
|
|
restart: unless-stopped
|
|
expose:
|
|
- "80"
|
|
# ports:
|
|
# - "80:80"
|
|
# - "8443:443" # SSL disabled for gemini test to avoid cert conflicts
|
|
volumes:
|
|
- ./nginx.gemini.conf:/etc/nginx/nginx.conf:ro
|
|
# - ./certbot/conf:/etc/letsencrypt:ro # Disable SSL for test
|
|
- ../web/out:/usr/share/nginx/html:ro
|
|
networks:
|
|
- mtad-network-gemini
|
|
depends_on:
|
|
- api
|
|
healthcheck:
|
|
test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
networks:
|
|
mtad-network-gemini:
|
|
driver: bridge
|
|
traefik:
|
|
external: true
|
|
|
|
volumes:
|
|
postgres_data_gemini:
|
|
driver: local
|
|
redis_data_gemini:
|
|
driver: local
|