dcbd9bab41
PR Checks / test-and-build (pull_request) Successful in 11m4s
GmRelay.Shared references Dapper.AOT with PrivateAssets=all, which prevents the runtime DLL from flowing to downstream projects. Telegram bot works because it explicitly references Dapper.AOT directly, but Discord bot did not — causing FileNotFoundException for Dapper.AOT at runtime, breaking the scheduler and slash commands. - Add Dapper.AOT 1.0.48 to GmRelay.DiscordBot.csproj - Add regression test: DiscordWorkerProject_ShouldExist asserts Dapper.AOT is present in the DiscordBot csproj - Bump version → 3.0.9 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
123 lines
3.9 KiB
YAML
123 lines
3.9 KiB
YAML
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: gmrelay
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
POSTGRES_DB: gmrelay_db
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
networks:
|
|
- gmrelay
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -U gmrelay -d gmrelay_db" ]
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
db-backup:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
POSTGRES_USER: gmrelay
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
POSTGRES_DB: gmrelay_db
|
|
PGPASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-7}
|
|
volumes:
|
|
- pgbackups:/backups
|
|
networks:
|
|
- gmrelay
|
|
entrypoint: ["sh", "-c"]
|
|
command:
|
|
- |
|
|
cat > /usr/local/bin/backup.sh << 'EOF'
|
|
#!/bin/sh
|
|
set -e
|
|
TMPFILE="/tmp/backup_$$.sql"
|
|
pg_dump -h db -U gmrelay -d gmrelay_db > "$TMPFILE"
|
|
gzip "$TMPFILE"
|
|
mv "$TMPFILE.gz" "/backups/gmrelay_db_$(date +%Y%m%d_%H%M%S).sql.gz"
|
|
find /backups -name 'gmrelay_db_*.sql.gz' -type f -mtime +${BACKUP_RETENTION_DAYS} -delete
|
|
EOF
|
|
chmod +x /usr/local/bin/backup.sh
|
|
echo "0 3 * * * /usr/local/bin/backup.sh" | crontab -
|
|
crond -f
|
|
|
|
bot:
|
|
image: git.codeanddice.ru/toutsu/gmrelay-bot:3.0.9
|
|
restart: always
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- "ConnectionStrings__gmrelaydb=Host=db;Port=5432;Database=gmrelay_db;Username=gmrelay;Password=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
|
|
- "Telegram__BotToken=${TELEGRAM_BOT_TOKEN:?Set TELEGRAM_BOT_TOKEN in .env}"
|
|
- "Telegram__MiniAppUrl=${TELEGRAM_MINI_APP_URL:-}"
|
|
networks:
|
|
- gmrelay
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8081/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
discord:
|
|
image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.0.9
|
|
restart: always
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- "ConnectionStrings__gmrelaydb=Host=db;Port=5432;Database=gmrelay_db;Username=gmrelay;Password=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
|
|
- "Discord__Token=${DISCORD_BOT_TOKEN:?Set DISCORD_BOT_TOKEN in .env}"
|
|
networks:
|
|
- gmrelay
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8082/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
web:
|
|
image: git.codeanddice.ru/toutsu/gmrelay-web:3.0.9
|
|
restart: always
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- "ConnectionStrings__gmrelaydb=Host=db;Port=5432;Database=gmrelay_db;Username=gmrelay;Password=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
|
|
- "Telegram__BotToken=${TELEGRAM_BOT_TOKEN:?Set TELEGRAM_BOT_TOKEN in .env}"
|
|
- "Telegram__BotUsername=${TELEGRAM_BOT_USERNAME:?Set TELEGRAM_BOT_USERNAME in .env}"
|
|
- "Telegram__MiniAppUrl=${TELEGRAM_MINI_APP_URL:-}"
|
|
- "Discord__ClientId=${DISCORD_CLIENT_ID:-}"
|
|
- "Discord__ClientSecret=${DISCORD_CLIENT_SECRET:-}"
|
|
- "Discord__RedirectUri=${DISCORD_REDIRECT_URI:-}"
|
|
ports:
|
|
- "${GMRELAY_WEB_PORT:-8080}:8080"
|
|
volumes:
|
|
- web_keys:/app/dataprotection-keys
|
|
networks:
|
|
- gmrelay
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
volumes:
|
|
pgdata:
|
|
name: ${POSTGRES_VOLUME_NAME:-game_pgdata}
|
|
web_keys:
|
|
name: ${WEB_KEYS_VOLUME_NAME:-gmrelay_web_keys}
|
|
pgbackups:
|
|
name: ${BACKUP_VOLUME_NAME:-game_pgbackups}
|
|
|
|
networks:
|
|
gmrelay:
|
|
driver: bridge
|