- Remove actions/upload-artifact@v4 (not supported on Gitea, GHESNotSupportedError) - Add job permissions (packages: write, contents: read) - Fix master branch condition (github.ref_name compatible with Gitea) - Fix Docker login: use gitea.actor + GITHUB_TOKEN instead of reserved GITEA_ secrets - Lowercase image tags per Docker spec (mrixs/mrixscraft-server) - Sync docker-compose.yml image reference
81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
# MrixsCraft — Production Docker Compose
|
|
# Usage: docker compose up -d
|
|
# Monitoring (when ready): docker compose --profile monitoring up -d
|
|
|
|
services:
|
|
caddy:
|
|
image: caddy:2-alpine
|
|
container_name: mc-caddy
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
- cdn_files:/var/www/cdn/files:ro
|
|
|
|
backend:
|
|
image: gitea.mrixs.me/mrixs/mrixscraft-server:latest
|
|
container_name: mc-backend
|
|
restart: unless-stopped
|
|
environment:
|
|
SERVER_PORT: 8080
|
|
DATABASE_URL: postgres://mcuser:${DB_PASSWORD}@postgres:5432/mcserver?sslmode=disable
|
|
CI_TOKEN: ${CI_TOKEN}
|
|
CAS_DIR: /var/www/cdn/files
|
|
SKINS_DIR: /var/www/cdn/skins
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
BASE_URL: https://minecraft.mrixs.me
|
|
volumes:
|
|
- cdn_files:/var/www/cdn/files
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
expose:
|
|
- "8080"
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: mc-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: mcserver
|
|
POSTGRES_USER: mcuser
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d:ro
|
|
- ./backups:/backups
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U mcuser -d mcserver"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
expose:
|
|
- "5432"
|
|
|
|
watchtower:
|
|
image: containrrr/watchtower
|
|
container_name: mc-watchtower
|
|
restart: unless-stopped
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
environment:
|
|
WATCHTOWER_CLEANUP: "true"
|
|
WATCHTOWER_POLL_INTERVAL: 300
|
|
WATCHTOWER_LABEL_ENABLE: "true"
|
|
|
|
volumes:
|
|
pgdata:
|
|
driver: local
|
|
cdn_files:
|
|
driver: local
|
|
caddy_data:
|
|
driver: local
|
|
caddy_config:
|
|
driver: local
|