name: investplay services: postgres: image: postgres:16-alpine container_name: investplay-postgres restart: always expose: - "5432" volumes: - pgdata:/var/lib/postgresql/data environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB:-investplay} healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB:-investplay}"] interval: 10s timeout: 5s retries: 5 start_period: 30s deploy: resources: limits: memory: 512M cpus: "1.0" reservations: memory: 256M cpus: "0.5" networks: - investplay redis: image: redis:7-alpine container_name: investplay-redis restart: always expose: - "6379" volumes: - redis-data:/data command: redis-server --appendonly yes --loglevel warning healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 start_period: 10s deploy: resources: limits: memory: 256M cpus: "0.5" reservations: memory: 128M cpus: "0.25" networks: - investplay minio: image: minio/minio:latest container_name: investplay-minio restart: always expose: - "9000" - "9001" ports: - "9000:9000" - "9001:9001" volumes: - minio-data:/data environment: MINIO_ROOT_USER: ${MINIO_ROOT_USER} MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD} command: server /data --console-address :9001 healthcheck: test: ["CMD", "mc", "ready", "local"] interval: 10s timeout: 5s retries: 5 start_period: 15s deploy: resources: limits: memory: 512M cpus: "1.0" reservations: memory: 256M cpus: "0.5" networks: - investplay api: build: context: . dockerfile: apps/api/Dockerfile container_name: investplay-api restart: always expose: - "3001" ports: - "3001:3001" environment: NODE_ENV: production DATABASE_URL: ${DATABASE_URL} REDIS_URL: ${REDIS_URL} MINIO_ENDPOINT: minio MINIO_PORT: 9000 MINIO_USE_SSL: false JWT_SECRET: ${JWT_SECRET} PORT: 3001 env_file: - .env.production healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health"] interval: 30s timeout: 10s start_period: 40s retries: 3 deploy: resources: limits: memory: 512M cpus: "1.0" reservations: memory: 256M cpus: "0.5" depends_on: postgres: condition: service_healthy redis: condition: service_healthy minio: condition: service_healthy networks: - investplay web: build: context: . dockerfile: apps/web/Dockerfile container_name: investplay-web restart: always expose: - "80" ports: - "80:80" healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"] interval: 30s timeout: 10s start_period: 10s retries: 3 deploy: resources: limits: memory: 256M cpus: "0.5" reservations: memory: 128M cpus: "0.25" depends_on: - api networks: - investplay cms: build: context: . dockerfile: apps/cms/Dockerfile container_name: investplay-cms restart: always expose: - "3000" ports: - "3000:3000" environment: NODE_ENV: production DATABASE_URL: ${CMS_DATABASE_URL} PAYLOAD_SECRET: ${PAYLOAD_SECRET} PORT: 3000 env_file: - .env.production healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"] interval: 30s timeout: 10s start_period: 30s retries: 3 deploy: resources: limits: memory: 512M cpus: "1.0" reservations: memory: 256M cpus: "0.5" depends_on: postgres: condition: service_healthy networks: - investplay portainer-agent: image: portainer/agent:latest container_name: investplay-portainer-agent restart: always ports: - "9001:9001" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - portainer-agent-data:/data deploy: resources: limits: memory: 128M cpus: "0.25" reservations: memory: 64M cpus: "0.1" networks: - investplay volumes: pgdata: name: investplay-pgdata redis-data: name: investplay-redis-data minio-data: name: investplay-minio-data portainer-agent-data: name: investplay-portainer-agent-data networks: investplay: name: investplay driver: bridge