diff --git a/docker-compose-test-worldserver.env b/docker-compose-test-worldserver.env deleted file mode 100644 index df79be1..0000000 --- a/docker-compose-test-worldserver.env +++ /dev/null @@ -1,75 +0,0 @@ -# ============================================== -# TEST WORLDSERVER ENVIRONMENT CONFIGURATION -# ============================================== -# This configuration is for testing worldserver with -# local game files vs. external volume mount - -# ============================================== -# IMAGE CONFIGURATION -# ============================================== -AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:14.0.0-dev -IMAGE_PULL_POLICY=if_not_present - -# ============================================== -# PLAYERBOT CONFIGURATION -# ============================================== -# Playerbot settings for AI-controlled bots -PLAYERBOT_ENABLED=1 -PLAYERBOT_MAX_BOTS=40 - -# ============================================== -# HEALTH CHECK CONFIGURATION -# ============================================== -# World server health check - extended for download time -WORLD_HEALTHCHECK_INTERVAL=30s -WORLD_HEALTHCHECK_TIMEOUT=10s -WORLD_HEALTHCHECK_RETRIES=3 -WORLD_HEALTHCHECK_START_PERIOD=1800s # 30 minutes for download/extraction - -# ============================================== -# NETWORK CONFIGURATION -# ============================================== -# Test external ports (different from main deployment) -WORLD_EXTERNAL_PORT_TEST=8216 # Different port to avoid conflict -SOAP_EXTERNAL_PORT_TEST=7779 # Different port to avoid conflict - -# Internal ports (container side) -WORLD_PORT=8085 -SOAP_PORT=7878 - -# ============================================== -# DEPLOYMENT CONFIGURATION -# ============================================== -# Storage root path - local: ./storage, production: /nfs/containers or custom mount -STORAGE_ROOT=./storage -# Storage configuration (same as other layers for config/logs) -STORAGE_PATH=${STORAGE_ROOT}/azerothcore - -# ============================================== -# CONTAINER NAMES -# ============================================== -# Test container name to avoid conflicts -CONTAINER_WORLDSERVER_TEST=ac-worldserver-test - -# Database container name (for external linking) -CONTAINER_MYSQL=ac-mysql - -# ============================================== -# NETWORK SETTINGS -# ============================================== -# Network must already exist from database layer -NETWORK_NAME=azerothcore - -# ============================================== -# DATABASE CONFIGURATION -# ============================================== -# Database credentials and connection info -MYSQL_HOST=ac-mysql -MYSQL_PORT=3306 -MYSQL_USER=root -MYSQL_ROOT_PASSWORD=azerothcore123 - -# Database names -DB_AUTH_NAME=acore_auth -DB_WORLD_NAME=acore_world -DB_CHARACTERS_NAME=acore_characters \ No newline at end of file diff --git a/docker-compose-test-worldserver.yml b/docker-compose-test-worldserver.yml deleted file mode 100644 index 6e01642..0000000 --- a/docker-compose-test-worldserver.yml +++ /dev/null @@ -1,192 +0,0 @@ -# ============================================== -# TEST WORLDSERVER WITH LOCAL GAME FILES -# ============================================== -# This is a test configuration to compare performance -# of worldserver with game files stored locally within -# the container vs. external volume mount - -services: - # Test world server with local game files (no external data volume) - ac-worldserver-test: - image: ${AC_WORLDSERVER_IMAGE} - pull_policy: ${IMAGE_PULL_POLICY} - container_name: ${CONTAINER_WORLDSERVER_TEST} - user: "0:0" # Run as root to handle permissions - stdin_open: true - tty: true - # depends_on: - # - ac-authserver # Assumes authserver is already running from main deployment - environment: - AC_LOGIN_DATABASE_INFO: "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_AUTH_NAME}" - AC_WORLD_DATABASE_INFO: "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_WORLD_NAME}" - AC_CHARACTER_DATABASE_INFO: "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_CHARACTERS_NAME}" - AC_UPDATES_ENABLE_DATABASES: "0" - AC_BIND_IP: "0.0.0.0" - AC_DATA_DIR: "/azerothcore/data" - AC_SOAP_PORT: "7878" - AC_PROCESS_PRIORITY: "0" - PLAYERBOT_ENABLED: "${PLAYERBOT_ENABLED}" - PLAYERBOT_MAX_BOTS: "${PLAYERBOT_MAX_BOTS}" - # Logger configuration - Use config file defaults with proper log level - AC_LOG_LEVEL: "2" - ports: - - "${WORLD_EXTERNAL_PORT_TEST}:${WORLD_PORT}" - - "${SOAP_EXTERNAL_PORT_TEST}:${SOAP_PORT}" - volumes: - # Only mount config and logs, NOT the data directory (game files will be internal) - - ${STORAGE_PATH}/config:/azerothcore/env/dist/etc - - ${STORAGE_PATH}/logs-test:/azerothcore/logs - - ${STORAGE_PATH}/modules:/azerothcore/modules - # Mount cache directory to persist downloaded files across container restarts - - ${STORAGE_PATH}/cache-test:/cache - restart: unless-stopped - networks: - - azerothcore - cap_add: - - SYS_NICE - entrypoint: ["/bin/bash", "-c"] - command: - - | - echo "๐Ÿงช Starting TEST worldserver with local game files..." - - # Install required packages for downloading - echo "๐Ÿ“ฆ Installing download tools..." - apt-get update > /dev/null 2>&1 - apt-get install -y curl wget unzip ca-certificates > /dev/null 2>&1 - - # Create cache and data directories - mkdir -p /cache /azerothcore/data - - echo "๐Ÿงช Starting TEST worldserver with cached local game files..." - echo "๐Ÿ“‚ Cache directory: /cache (persistent across restarts)" - echo "๐ŸŽฏ Game files will be copied to local container storage for performance testing" - - cd /tmp - - # Get the latest release info from wowgaming/client-data - echo '๐Ÿ“ก Fetching latest client data release info...' - RELEASE_INFO=$$(wget -qO- https://api.github.com/repos/wowgaming/client-data/releases/latest 2>/dev/null) - - if [ -n "$$RELEASE_INFO" ]; then - LATEST_URL=$$(echo "$$RELEASE_INFO" | grep '"browser_download_url":' | grep '\.zip' | cut -d'"' -f4 | head -1) - LATEST_TAG=$$(echo "$$RELEASE_INFO" | grep '"tag_name":' | cut -d'"' -f4) - fi - - if [ -z "$$LATEST_URL" ]; then - echo 'โŒ Could not fetch latest release URL' - echo '๐Ÿ“ฅ Using fallback: direct download from v16 release' - LATEST_URL='https://github.com/wowgaming/client-data/releases/download/v16/data.zip' - LATEST_TAG='v16' - fi - - echo "๐Ÿ“ Latest release: $$LATEST_TAG" - echo "๐Ÿ“ฅ Download URL: $$LATEST_URL" - - # Cache file paths - CACHE_FILE="/cache/client-data-$$LATEST_TAG.zip" - VERSION_FILE="/cache/client-data-version.txt" - - # Check if we have a cached version - if [ -f "$$CACHE_FILE" ] && [ -f "$$VERSION_FILE" ]; then - CACHED_VERSION=$$(cat "$$VERSION_FILE" 2>/dev/null) - if [ "$$CACHED_VERSION" = "$$LATEST_TAG" ]; then - echo "๐ŸŽ‰ Found cached client data for $$LATEST_TAG" - echo "๐Ÿ“Š Cached file size: $$(ls -lh "$$CACHE_FILE" | awk '{print $$5}')" - echo "โšก Using cached download (no internet download needed)" - cp "$$CACHE_FILE" data.zip - else - echo "๐Ÿ”„ Cached version ($$CACHED_VERSION) differs from latest ($$LATEST_TAG)" - echo "๐Ÿ“ฅ Downloading new version..." - wget --progress=dot:giga -O "$$CACHE_FILE.tmp" "$$LATEST_URL" - if [ $$? -eq 0 ]; then - mv "$$CACHE_FILE.tmp" "$$CACHE_FILE" - echo "$$LATEST_TAG" > "$$VERSION_FILE" - echo "โœ… Download completed and cached" - cp "$$CACHE_FILE" data.zip - else - echo "โŒ Download failed!" - exit 1 - fi - fi - else - echo "๐Ÿ’พ No cache found, downloading and caching..." - echo "โฑ๏ธ Download started at: $(date)" - wget --progress=dot:giga -O "$$CACHE_FILE.tmp" "$$LATEST_URL" - if [ $$? -eq 0 ]; then - mv "$$CACHE_FILE.tmp" "$$CACHE_FILE" - echo "$$LATEST_TAG" > "$$VERSION_FILE" - echo "โœ… Download completed and cached at: $(date)" - echo "๐Ÿ“Š File size: $$(ls -lh "$$CACHE_FILE" | awk '{print $$5}')" - cp "$$CACHE_FILE" data.zip - else - echo "โŒ Download failed!" - exit 1 - fi - fi - - # Extract game files to local container storage for performance testing - echo "๐Ÿ“‚ Extracting client data to local container storage..." - echo "๐ŸŽฏ This tests performance with files stored locally vs. external volume" - echo "โฑ๏ธ Extraction started at: $(date)" - - # Clear any existing data - rm -rf /azerothcore/data/maps /azerothcore/data/vmaps /azerothcore/data/mmaps /azerothcore/data/dbc - - # Extract with progress monitoring - unzip -o -q data.zip -d /azerothcore/data/ & - UNZIP_PID=$! - - # Simple progress indicator - while kill -0 "$$UNZIP_PID" 2>/dev/null; do - echo "โณ Extracting... ($(date '+%H:%M:%S'))" - sleep 30 - done - - wait $$UNZIP_PID - UNZIP_EXIT_CODE=$$? - - if [ $$UNZIP_EXIT_CODE -ne 0 ]; then - echo "โŒ Extraction failed!" - exit 1 - fi - - # Clean up zip file - rm -f data.zip - - echo "โœ… Extraction completed at: $(date)" - echo "๐Ÿ’พ Game files are now stored locally in container for performance testing" - - # Verify required directories exist and have content - echo '๐Ÿ“ Verifying extracted directories:' - ALL_GOOD=true - for dir in maps vmaps mmaps dbc; do - if [ -d "/azerothcore/data/$$dir" ] && [ -n "$$(ls -A /azerothcore/data/$$dir 2>/dev/null)" ]; then - DIR_SIZE=$$(du -sh /azerothcore/data/$$dir 2>/dev/null | cut -f1) - echo "โœ… $$dir directory: OK ($$DIR_SIZE)" - else - echo "โŒ $$dir directory: MISSING or EMPTY" - ALL_GOOD=false - fi - done - - if [ "$$ALL_GOOD" != "true" ]; then - echo "โŒ Game data verification failed!" - exit 1 - fi - - echo "๐ŸŽ‰ Local game data setup complete!" - echo "๐Ÿš€ Starting worldserver..." - echo "โฑ๏ธ Worldserver startup time: $(date)" - - # Start the worldserver - exec /azerothcore/env/dist/bin/worldserver - healthcheck: - test: ["CMD", "sh", "-c", "ps aux | grep '[w]orldserver' | grep -v grep || exit 1"] - interval: ${WORLD_HEALTHCHECK_INTERVAL} - timeout: ${WORLD_HEALTHCHECK_TIMEOUT} - retries: ${WORLD_HEALTHCHECK_RETRIES} - start_period: 1800s # 30 minutes to allow for download and extraction - -networks: - azerothcore: - external: true \ No newline at end of file diff --git a/readme.md b/readme.md index 5d6e20c..1e411fd 100644 --- a/readme.md +++ b/readme.md @@ -126,28 +126,78 @@ acore-compose/ | Container | Image | Purpose | Exposed Ports | |-----------|-------|---------|---------------| -| `ac-mysql` | mysql:8.0 | MySQL database server | 64306:3306 | -| `ac-authserver` | acore/ac-wotlk-authserver:14.0.0-dev | Authentication server | 3784:3724 | -| `ac-worldserver` | acore/ac-wotlk-worldserver:14.0.0-dev | Game world server | 8215:8085, 7778:7878 | -| `ac-eluna` | acore/eluna-ts:master | Lua scripting engine | - | -| `ac-phpmyadmin` | phpmyadmin/phpmyadmin:latest | Database management web UI | 8081:80 | -| `ac-keira3` | uprightbass360/keira3:latest | Production database editor with API | 4201:8080 | -| `ac-backup` | mysql:8.0 | Automated backup service | - | -| `ac-modules` | alpine/git:latest | Module management | - | -| `ac-post-install` | alpine:latest | Automatic post-installation configuration | - | +| **Database Layer** | +| `ac-mysql` | mysql:8.0 | MySQL database server | 64306:3306 | +| `ac-db-init` | mysql:8.0 | Database initialization (one-time) | - | +| `ac-db-import` | acore/ac-wotlk-db-import:14.0.0-dev | Database import (one-time) | - | +| `ac-backup` | mysql:8.0 | Automated backup service with GitHub scripts | - | +| **Services Layer** | +| `ac-client-data` | alpine:latest | Game client data download/extraction | - | +| `ac-authserver` | acore/ac-wotlk-authserver:14.0.0-dev | Authentication server | 3784:3724 | +| `ac-worldserver` | acore/ac-wotlk-worldserver:14.0.0-dev | Game world server | 8215:8085, 7778:7878 | +| `ac-eluna` | acore/eluna-ts:master | Lua scripting engine | - | +| `ac-modules` | alpine/git:latest | Module management with GitHub script download | - | +| `ac-post-install` | alpine:latest | Automatic post-installation configuration | - | +| **Tools Layer** | +| `ac-phpmyadmin` | phpmyadmin/phpmyadmin:latest | Database management web UI | 8081:80 | +| `ac-keira3` | uprightbass360/keira3:latest | Production database editor with API | 4201:8080 | ### Container Relationships ```mermaid graph TD - A[ac-mysql] -->|depends_on| B[ac-db-init] - B -->|depends_on| C[ac-db-import] - C -->|depends_on| D[ac-authserver] - C -->|depends_on| E[ac-worldserver] - E -->|depends_on| F[ac-eluna] - A -->|backup| G[ac-backup] + %% Database Layer + A[ac-mysql] --> B[ac-db-init] + A --> C[ac-db-import] + A --> D[ac-backup] + + %% Services Layer + E[ac-client-data] --> F[ac-authserver] + F --> G[ac-worldserver] + G --> H[ac-eluna] + I[ac-modules] --> J[ac-post-install] + + %% Tools Layer (External) + K[ac-phpmyadmin] -.->|connects to| A + L[ac-keira3] -.->|connects to| A + + %% Database dependencies + A -.->|provides data| F + A -.->|provides data| G + + %% Layer grouping + subgraph "Database Layer" + A + B + C + D + end + + subgraph "Services Layer" + E + F + G + H + I + J + end + + subgraph "Tools Layer" + K + L + end ``` +**Layer Dependencies**: +- **Database Layer**: Independent, starts first +- **Services Layer**: Depends on database layer being ready +- **Tools Layer**: Connects to database layer externally + +**Container Dependencies**: +- `ac-worldserver` depends on: `ac-authserver`, `ac-client-data` +- `ac-post-install` depends on: `ac-modules` +- All game services connect to: `ac-mysql` + ### Network Architecture - **Network Name**: `azerothcore` - **Type**: Bridge network