services: mysql: container_name: bfacore-mysql image: mysql:8.4 restart: unless-stopped command: ["--max_allowed_packet=1073741824", "--wait_timeout=28800"] environment: MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-admin} volumes: - mysql_data:/var/lib/mysql - ./docker/mysql-init:/docker-entrypoint-initdb.d:ro ports: - "3306:3306" healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${DB_ROOT_PASSWORD:-admin}"] interval: 5s timeout: 5s retries: 30 # EN: Imports the base SQL dumps (auth/world/characters/hotfixes) that you # MUST download separately (not included in the repo, see # docker/README.md) and place in ./sql/base/*.sql before running this. # docker compose run --rm db-import # ES: Importa los dumps SQL base (auth/world/characters/hotfixes) que TENES # que descargar aparte (no vienen en el repo, ver docker/README.md) y # colocar en ./sql/base/*.sql antes de correr esto. # docker compose run --rm db-import db-import: container_name: bfacore-db-import image: mysql:8.4 profiles: ["tools"] depends_on: mysql: condition: service_healthy environment: DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-admin} volumes: - ./sql/base:/sql/base:ro - ./docker/db-import.sh:/db-import.sh:ro entrypoint: ["bash", "/db-import.sh"] # EN: Fast C++ iteration loop. Unlike the "worldserver"/"bnetserver" # image builds (which rebuild from scratch every time in this Docker # Desktop setup, since BuildKit cache mounts don't survive between # separate `docker compose build` runs here), this bind-mounts the repo # and a *real* named volume (dev_build_cache, not a cache mount) for # /build, so ninja does genuine incremental compiles. Use this to # quickly check that a code change compiles; run # `docker compose build worldserver bnetserver` afterwards (slower) only # when you actually want to test it in a running container. # docker compose run --rm dev-builder # ES: Loop rapido de iteracion en C++. A diferencia de las imagenes de # "worldserver"/"bnetserver" (que en este Docker Desktop se reconstruyen # de cero cada vez, porque los cache mounts de BuildKit no sobreviven # entre corridas separadas de `docker compose build`), esto monta el # repo y un volumen nombrado *real* (dev_build_cache, no un cache mount) # para /build, asi que ninja hace compilacion incremental de verdad. Usa # esto para validar rapido que un cambio de codigo compila; corre # `docker compose build worldserver bnetserver` despues (mas lento) solo # cuando quieras probarlo de verdad en un contenedor corriendo. # docker compose run --rm dev-builder dev-builder: container_name: bfacore-dev-builder build: context: . dockerfile: docker/Dockerfile.dev-builder profiles: ["tools"] volumes: - .:/src - dev_build_cache:/build # EN: Install output, shared with worldserver/bnetserver ONLY when # started via docker-compose.dev.yml (see that file / docker/README.md). # ES: Salida de la instalacion, compartida con worldserver/bnetserver # SOLO cuando se arrancan via docker-compose.dev.yml (ver ese archivo # / docker/README.md). - dev_install:/opt/bfacore working_dir: /src command: - bash - -c - | set -e cmake -S /src -B /build -G Ninja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DTOOLS=0 \ -DSCRIPTS=static \ -DWITHOUT_GIT=1 \ -DCMAKE_INSTALL_PREFIX=/opt/bfacore cmake --build /build -j"$(nproc)" cmake --build /build --target install bnetserver: container_name: bfacore-bnetserver build: context: . dockerfile: docker/Dockerfile target: runtime restart: unless-stopped depends_on: mysql: condition: service_healthy environment: DB_HOST: mysql DB_PORT: 3306 DB_USER: root DB_PASS: ${DB_ROOT_PASSWORD:-admin} volumes: - bnetserver_etc:/opt/bfacore/etc entrypoint: ["/opt/bfacore/entrypoint.sh", "bnetserver"] ports: - "1119:1119" - "8081:8081" worldserver: container_name: bfacore-worldserver build: context: . dockerfile: docker/Dockerfile target: runtime restart: unless-stopped depends_on: mysql: condition: service_healthy environment: DB_HOST: mysql DB_PORT: 3306 DB_USER: root DB_PASS: ${DB_ROOT_PASSWORD:-admin} volumes: - worldserver_etc:/opt/bfacore/etc # EN: Client-extracted data (dbc/maps/vmaps/mmaps). See docker/README.md. # ES: Datos extraidos del cliente (dbc/maps/vmaps/mmaps). Ver docker/README.md. - ./client-data:/opt/bfacore/bin/ClientData:ro entrypoint: ["/opt/bfacore/entrypoint.sh", "worldserver"] ports: - "8085:8085" # EN: InstanceServerPort (World.cpp, default 8086): separate port used # by the "Enter World" hand-off (WorldSession::SendConnectToInstance). # Without publishing it, the client reaches character select fine but # entering the world the 2nd connect fails and shows "World server is # down". # ES: InstanceServerPort (World.cpp, default 8086): puerto separado que # usa el hand-off de "Enter World" (WorldSession::SendConnectToInstance). # Sin publicarlo, el cliente entra a character select bien pero al # entrar al mundo el 2do connect falla y muestra "World server is down". - "8086:8086" # EN: stdin_open without tty: allows sending commands to the console # via `docker attach` + piped stdin (with tty:true Docker refuses to # attach if stdin isn't an interactive terminal). # ES: stdin_open sin tty: permite mandar comandos a la consola con # `docker attach` + stdin canalizado (con tty:true Docker rechaza el # attach si stdin no es un terminal interactivo). stdin_open: true tty: false volumes: mysql_data: bnetserver_etc: worldserver_etc: dev_build_cache: dev_install: