Skip to content

Installation Linux Compose

boyism80 edited this page Jul 4, 2026 · 2 revisions

Linux — Docker Compose

Run the full fb stack on a single Linux host with Docker Compose. This is the default Linux path for local development and small staging environments — closest to Windows — Runner.

Parent guide: Linux Installation

Manifests live in infra/compose/. See also infra/compose/README.md.


When to use Compose

Use Compose Use Kubernetes instead
One machine, no cluster Production cluster, multiple nodes
Fast docker compose up NodePort / LoadBalancer at scale
Single world (or few profiles) Many worlds with isolated StatefulSets
Developer onboarding CI deploy to shared cluster

All application images are built from existing server/*/Dockerfile definitions — same Docker build pipeline as Kubernetes.


Prerequisites

Requirement Notes
Linux x64 Ubuntu 24.04 or similar
Docker + Compose v2 docker compose plugin
Git + submodules Clone per Linux Installation
Disk space 10 GB+ free for image layers and volumes

No Kubernetes, Pulumi, or host-native toolchain (GCC, CMake on host) required.


Quick start

cp infra/compose/.env.example infra/compose/.env
# Set FB_HOST to your LAN IP if clients connect remotely

bash tools/compose-config.sh
bash tools/compose-build.sh
docker compose -f infra/compose/docker-compose.yml --profile infra --profile app up -d

Or: bash tools/compose-up.sh

Optional profiles:

Profile Services
infra mysql, redis, rabbitmq
app internal, write-back, log, marketplace, admin-tool, gateway, login, game
world-2 Additional login/game pair (optional)

Example:

docker compose --profile infra --profile app up -d

Service layout

Infrastructure (profile: infra)

Service Image Purpose
mysql mysql:8.0 Unified + world databases
redis redis:7-alpine Cache / sessions
rabbitmq rabbitmq:3-management AMQP (+ management UI on 15672)

Volumes: mysql_data, redis_data — persist across restarts.

Published ports (dev defaults):

Service Host port
MySQL 3306
Redis 6379
RabbitMQ AMQP 5672
RabbitMQ management 15672

Migrations run via Internal on startup (Database:AutoMigration), not via MySQL init scripts.

Application services (profile: app)

Build from repo Dockerfiles:

Service Dockerfile Depends on
internal server/http/Dockerfile (SERVICE=internal) mysql, redis, rabbitmq
write-back server/http/Dockerfile (SERVICE=write-back) mysql, redis, rabbitmq, internal
log server/http/Dockerfile (SERVICE=log) rabbitmq
marketplace server/http/Dockerfile (SERVICE=marketplace) mysql, internal
admin-tool server/http/Dockerfile (SERVICE=admin-tool) internal
gateway server/gateway/Dockerfile internal, rabbitmq
login server/login/Dockerfile mysql, redis, internal
game server/game/Dockerfile mysql, redis, rabbitmq, login

Build order (matches CI):

  1. fb/data:localserver/fb/data/Dockerfile
  2. fb/build:localserver/fb/Dockerfile
  3. C++ then .NET service images

Networking

Single Compose network (e.g. fb-dev). Services resolve each other by service name (mysql, internal, …).

FB_HOST — IP or hostname clients use to connect (same role as Pulumi host on Kubernetes):

  • LAN: host machine IP
  • Same machine: 127.0.0.1 with published ports

Gateway / Login / Game configs must expose FB_HOST, not Docker internal DNS names.

Configuration

Recommended approach: tools/compose-config.sh generates infra/compose/config/ from .env before compose up (Runner-like).

Example .env:

FB_HOST=192.168.1.100
MYSQL_ROOT_PASSWORD=admin
RABBITMQ_USER=fb
RABBITMQ_PASSWORD=admin
GATEWAY_PORT=3001
LOGIN_PORT=3002
GAME_PORT=3004
INTERNAL_PORT=3000
ASPNETCORE_ENVIRONMENT=Development

Repository layout

infra/compose/
  docker-compose.yml
  config/              # appsettings + C++ templates
  .env.example
  README.md
tools/compose-config.sh
tools/compose-build.sh
tools/compose-up.sh

Related pages

Clone this wiki locally