services: db: container_name: waifuos-db build: context: .. dockerfile: docker/db/Dockerfile.postgres env_file: - .env ports: - "${POSTGRES_DB_PORT}:5432" volumes: - ${DATA_PATH:-../data}/postgres:/var/lib/postgresql/data - ./speech-gateway/init-db.sh:/docker-entrypoint-initdb.d/speech-gateway-init-db.sh:ro - ./chatmemory/init-db.sh:/docker-entrypoint-initdb.d/chatmemory-init-db.sh:ro - ./aiavatar/init-db.sh:/docker-entrypoint-initdb.d/aiavatar-init-db.sh:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] interval: 10s timeout: 5s retries: 5 start_period: 30s restart: unless-stopped pgadmin4: container_name: waifuos-pgadmin4 image: dpage/pgadmin4:8.14 env_file: - .env ports: - "${PGADMIN_PORT}:80" volumes: - ${DATA_PATH:-../data}/pgadmin:/var/lib/pgadmin - ./pgadmin/pgadmin-servers.json:/pgadmin4/servers.json depends_on: db: condition: service_healthy restart: unless-stopped speech-gateway: container_name: speech-gateway-app build: context: .. dockerfile: docker/speech-gateway/Dockerfile.spgw.app env_file: - .env ports: - "${SPGW_PORT}:8000" command: ["uvicorn", "${SPGW_MAIN_MODULE}:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] volumes: - ${DATA_PATH:-../data}/speech_gateway/cache:/app/cache depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped aiavatar: container_name: aiavatar-app build: context: .. dockerfile: docker/aiavatar/Dockerfile.aiavatar.app env_file: - .env ports: - "${AIAVATAR_PORT}:8000" command: ["uvicorn", "${AIAVATAR_MAIN_MODULE}:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] volumes: - ../server/aiavatar:/app - ${DATA_PATH:-../data}/aiavatar:/data depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped chatmemory: container_name: chatmemory-app build: context: .. dockerfile: docker/chatmemory/Dockerfile.chatmemory.app env_file: - .env ports: - "${CM_PORT}:8000" command: ["uvicorn", "${CM_MAIN_MODULE}:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped voicevox: container_name: voicevox image: voicevox/voicevox_engine:cpu-latest env_file: - .env ports: - "${VOICEVOX_PORT}:50021" restart: unless-stopped sbv2-api-lite: container_name: sbv2-api-lite-app build: context: .. dockerfile: docker/sbv2lite/Dockerfile.sbv2.app env_file: - .env ports: - "${SBV2_PORT}:8000" command: ["uvicorn", "${SBV2_MAIN_MODULE}:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] volumes: - ${DATA_PATH:-../data}/sbv2-api-lite/model:/app/model healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped nginx: container_name: waifuos-nginx image: nginx:latest ports: - "8012:80" - "8443:443" volumes: - ${DATA_PATH:-../data}/nginx/conf.d:/etc/nginx/conf.d - ${DATA_PATH:-../data}/nginx/html:/var/www/html - ${DATA_PATH:-../data}/certbot:/etc/letsencrypt depends_on: - aiavatar - chatmemory - speech-gateway - voicevox - sbv2-api-lite - pgadmin4 restart: always certbot: container_name: waifuos-certbot image: certbot/certbot:latest volumes: - ${DATA_PATH:-../data}/nginx/html:/var/www/html - ${DATA_PATH:-../data}/certbot:/etc/letsencrypt command: ["--version"] profiles: ["certbot"]