96 lines
2.3 KiB
YAML
96 lines
2.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# MongoDB Service
|
|
mongodb:
|
|
image: mongo:6.0
|
|
container_name: infinity-mongodb
|
|
restart: unless-stopped
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
|
|
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
|
|
volumes:
|
|
- mongodb_data:/data/db
|
|
ports:
|
|
- "27017:27017"
|
|
networks:
|
|
- infinity-network
|
|
healthcheck:
|
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
# Web Application (Next.js)
|
|
webapp:
|
|
build:
|
|
context: .
|
|
dockerfile: webapp/Dockerfile
|
|
target: runner
|
|
container_name: infinity-webapp
|
|
restart: unless-stopped
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-production}
|
|
- DB_URI=${DB_URI}
|
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
|
env_file: .env
|
|
ports:
|
|
- "${APP_PORT:-8081}:3000"
|
|
networks:
|
|
- infinity-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "http://localhost:3000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# Worker Service (temporarily disabled for initial deployment)
|
|
# worker:
|
|
# build:
|
|
# context: .
|
|
# dockerfile: worker/Dockerfile
|
|
# container_name: infinity-worker
|
|
# restart: unless-stopped
|
|
# depends_on:
|
|
# mongodb:
|
|
# condition: service_healthy
|
|
# environment:
|
|
# - NODE_ENV=${NODE_ENV:-production}
|
|
# - DB_URI=${DB_URI}
|
|
# env_file: .env
|
|
# networks:
|
|
# - infinity-network
|
|
|
|
# Helper Service (runs once to create admin account)
|
|
# create-admin:
|
|
# build:
|
|
# context: .
|
|
# dockerfile: helpers/Dockerfile
|
|
# container_name: infinity-create-admin
|
|
# depends_on:
|
|
# mongodb:
|
|
# condition: service_healthy
|
|
# environment:
|
|
# - DB_URI=${DB_URI}
|
|
# - ADMIN_USERNAME=${ADMIN_USERNAME}
|
|
# - ADMIN_PASSWORD=${ADMIN_PASSWORD}
|
|
# - NODE_ENV=${NODE_ENV:-production}
|
|
# env_file: .env
|
|
# networks:
|
|
# - infinity-network
|
|
# command: sh -c "python create_account.py"
|
|
# profiles: ["create-admin"]
|
|
|
|
networks:
|
|
infinity-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
mongodb_data:
|
|
driver: local |