This commit is contained in:
yznahmad 2025-06-20 00:52:57 +03:00
parent 2d13139bca
commit dc9daa9685
2 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,3 @@
version: '3.8'
services:
# MongoDB Service
mongodb:
@ -16,6 +14,11 @@ services:
- "27017:27017"
networks:
- infinity-network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# Web Application (Next.js)
webapp:
@ -25,11 +28,13 @@ services:
container_name: infinity-webapp
restart: always
depends_on:
- mongodb
mongodb:
condition: service_healthy
environment:
- NODE_ENV=${NODE_ENV}
- DB_URI=${DB_URI}
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
env_file: .env
ports:
- "3000:3000"
networks:
@ -43,9 +48,11 @@ services:
container_name: infinity-worker
restart: always
depends_on:
- mongodb
mongodb:
condition: service_healthy
environment:
- DB_URI=${DB_URI}
env_file: .env
networks:
- infinity-network
@ -62,6 +69,7 @@ services:
- DB_URI=${DB_URI}
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
env_file: .env
networks:
- infinity-network
# This ensures the container exits after creating the admin account
@ -73,4 +81,4 @@ networks:
volumes:
mongodb_data:
driver: local
driver: local

View File

@ -1,7 +1,4 @@
# requirements.txt
# Time and datetime
time
datetime
# Python-dotenv for loading environment variables
python-dotenv
# pymongo for connecting to MongoDB