- Docker
19.03+ - Docker Compose v2 (
docker compose)
- Create
.env:cp env.dist .env
- Create
config.yml:make config
- Ensure local DB is selected:
make internal_db
- Build and start everything:
make setup-all
Note
If the database is still starting, make db-setup may fail the first time.
Just rerun it after a few seconds.
If you run docker compose down -v, the local DB volume is removed and the databases are empty.
Run make db-setup or make db-restore after that.
- Create databases:
make db-create
- Drop databases:
make db-drop
- Populate schema:
make db-populate
- Apply updates:
make db-update
- Full setup (create โ populate โ update):
make db-setup
- Backup:
make db-backup
- Restore (use a specific backup folder name):
make db-restore BACKUP=<folder>
Note
All database names use the prefix from .env (DB_PREFIX).
- Set these values in
.env:EXTERNAL_DB_HOST= EXTERNAL_DB_PORT=3306 EXTERNAL_DB_USERNAME= EXTERNAL_DB_PASSWORD= - Apply external DB config:
make external_db
- Start containers:
make up
This updates etc/config/config.yml with concrete values and disables the local sql
service by clearing COMPOSE_PROFILES.
make internal_db
make upThis rewrites etc/config/config.yml with local values and enables the localdb profile.
DB_PREFIX=alpha_
Database names become${DB_PREFIX}auth,${DB_PREFIX}realm,${DB_PREFIX}world,${DB_PREFIX}dbc.MYSQL_PORT=3306
Port used inside the Docker network.MYSQL_HOST_PORT=3300
Port exposed on your host (useful when 3306 is already in use).COMPOSE_PROFILES=localdb
Enables the local MariaDB container.
If config.yml is owned by root (often created by a container), fix it once:
sudo chown $USER:$USER etc/config/config.yml