130 lines
4.4 KiB
YAML
130 lines
4.4 KiB
YAML
################################################################################
|
|
# CubeAdmin — Docker Compose
|
|
#
|
|
# Usage:
|
|
# 1. Copy .env.example to .env and fill in your values
|
|
# 2. docker compose up -d
|
|
#
|
|
# Services:
|
|
# - cubeadmin : The admin panel (Next.js + Bun)
|
|
# - minecraft : Minecraft server (optional — disable if you manage your own)
|
|
# - bluemap : BlueMap 3D map (optional)
|
|
#
|
|
################################################################################
|
|
|
|
services:
|
|
# ─── CubeAdmin panel ─────────────────────────────────────────────────────
|
|
cubeadmin:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
container_name: cubeadmin
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PORT:-3000}:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3000
|
|
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:?BETTER_AUTH_SECRET is required}
|
|
- BETTER_AUTH_URL=${BETTER_AUTH_URL:-http://localhost:3000}
|
|
- RESEND_API_KEY=${RESEND_API_KEY:-}
|
|
- EMAIL_FROM=${EMAIL_FROM:-CubeAdmin <noreply@example.com>}
|
|
- MC_SERVER_PATH=/mc-server
|
|
- MC_RCON_HOST=minecraft
|
|
- MC_RCON_PORT=${MC_RCON_PORT:-25575}
|
|
- MC_RCON_PASSWORD=${MC_RCON_PASSWORD:?MC_RCON_PASSWORD is required}
|
|
- BLUEMAP_URL=${BLUEMAP_URL:-}
|
|
- DATABASE_PATH=/app/data/cubeadmin.db
|
|
- BACKUPS_PATH=/app/backups
|
|
- TRUSTED_ORIGINS=${TRUSTED_ORIGINS:-http://localhost:3000}
|
|
- INITIAL_ADMIN_EMAIL=${INITIAL_ADMIN_EMAIL:-admin@example.com}
|
|
- INITIAL_ADMIN_NAME=${INITIAL_ADMIN_NAME:-Administrator}
|
|
- INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD:-ChangeMe123!}
|
|
volumes:
|
|
# Persistent database
|
|
- cubeadmin_data:/app/data
|
|
# Persistent backups
|
|
- ${BACKUPS_PATH:-./backups}:/app/backups
|
|
# Mount Minecraft server directory (read-write for file management)
|
|
- ${MC_DATA_PATH:-./mc-data}:/mc-server
|
|
networks:
|
|
- cubeadmin_net
|
|
depends_on:
|
|
minecraft:
|
|
condition: service_healthy
|
|
required: false
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
# ─── Minecraft Server (Paper MC) ─────────────────────────────────────────
|
|
# Remove or comment out this service if you manage your Minecraft server separately
|
|
minecraft:
|
|
image: itzg/minecraft-server:latest
|
|
container_name: minecraft
|
|
restart: unless-stopped
|
|
tty: true
|
|
stdin_open: true
|
|
ports:
|
|
- "${MC_PORT:-25565}:25565"
|
|
# Uncomment to expose RCON port externally (not recommended for security)
|
|
# - "25575:25575"
|
|
environment:
|
|
# Server type: VANILLA, PAPER, SPIGOT, FORGE, FABRIC, BUKKIT, BEDROCK
|
|
- TYPE=${MC_TYPE:-PAPER}
|
|
- VERSION=${MC_VERSION:-LATEST}
|
|
- EULA=TRUE
|
|
- MEMORY=${MC_MEMORY:-2G}
|
|
- MAX_PLAYERS=${MC_MAX_PLAYERS:-20}
|
|
- MOTD=${MC_MOTD:-Powered by CubeAdmin}
|
|
# RCON (required for CubeAdmin command execution)
|
|
- ENABLE_RCON=true
|
|
- RCON_PORT=25575
|
|
- RCON_PASSWORD=${MC_RCON_PASSWORD:?MC_RCON_PASSWORD is required}
|
|
# Performance
|
|
- USE_AIKAR_FLAGS=true
|
|
- VIEW_DISTANCE=10
|
|
- SIMULATION_DISTANCE=8
|
|
# Ops
|
|
- OPS=${MC_OPS:-}
|
|
- WHITELIST=${MC_WHITELIST:-}
|
|
- ENABLE_WHITELIST=false
|
|
volumes:
|
|
- ${MC_DATA_PATH:-./mc-data}:/data
|
|
networks:
|
|
- cubeadmin_net
|
|
healthcheck:
|
|
test: ["CMD", "mc-health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 120s
|
|
|
|
# ─── BlueMap (optional 3D map) ───────────────────────────────────────────
|
|
# BlueMap is usually run as a plugin inside the MC server.
|
|
# This service provides a standalone BlueMap web viewer.
|
|
# Configure BLUEMAP_URL=http://localhost:8100 in your .env
|
|
#
|
|
# bluemap:
|
|
# image: nginx:alpine
|
|
# container_name: bluemap
|
|
# restart: unless-stopped
|
|
# ports:
|
|
# - "8100:80"
|
|
# volumes:
|
|
# - ${MC_DATA_PATH:-./mc-data}/plugins/BlueMap/web:/usr/share/nginx/html:ro
|
|
# networks:
|
|
# - cubeadmin_net
|
|
|
|
volumes:
|
|
cubeadmin_data:
|
|
name: cubeadmin_data
|
|
|
|
networks:
|
|
cubeadmin_net:
|
|
name: cubeadmin_net
|
|
driver: bridge
|