From 607789c8a31982d7c6a8a313a7dc46bd600e66c5 Mon Sep 17 00:00:00 2001 From: yznahmad Date: Thu, 3 Jul 2025 02:14:09 +0300 Subject: [PATCH] Add v120g 212ssu3 --- docker-compose.yml | 88 ++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 50 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ad3324c..48276cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,9 @@ -version: '3.8' - services: # MongoDB Service mongodb: image: mongo:6.0 container_name: infinity-mongodb - restart: unless-stopped + restart: always environment: MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME} MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD} @@ -21,71 +19,61 @@ services: interval: 10s timeout: 5s retries: 5 - start_period: 30s # Web Application (Next.js) webapp: build: - context: ./webapp - dockerfile: Dockerfile - target: runner + context: . + dockerfile: webapp/Dockerfile container_name: infinity-webapp - restart: unless-stopped + restart: always depends_on: mongodb: condition: service_healthy environment: - - NODE_ENV=${NODE_ENV:-production} + - NODE_ENV=${NODE_ENV} - DB_URI=${DB_URI} - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} env_file: .env ports: - - "${APP_PORT:-8081}:3000" + - "8081:3000" # Let Docker assign a dynamic host port 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 + # Worker Service + worker: + build: + context: . + dockerfile: worker/Dockerfile + container_name: infinity-worker + restart: always + depends_on: + mongodb: + condition: service_healthy + environment: + - 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"] + 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} + env_file: .env + networks: + - infinity-network + # This ensures the container exits after creating the admin account + command: sh -c "python create_account.py" networks: infinity-network: