This commit is contained in:
@@ -9,6 +9,14 @@
|
||||
# Then: webapp on http://localhost:8080, API on http://localhost:5000,
|
||||
# Scalar API reference on http://localhost:5000/scalar.
|
||||
#
|
||||
# LaDOSE.DiscordBot is here too, behind the "bot" profile, so it stays out of the way
|
||||
# until you have a Discord token to give it — an unconfigured bot cannot start at all,
|
||||
# it can only crash-loop.
|
||||
#
|
||||
# docker compose --profile bot up --build everything, bot included
|
||||
# docker compose --profile bot up -d bot just the bot
|
||||
# docker compose logs -f bot follow it
|
||||
#
|
||||
# The database is NOT part of this stack — it stays wherever appsettings.json points.
|
||||
# Copy .env.example to .env to change the ports, the connection string or the API keys.
|
||||
name: ladose
|
||||
@@ -35,6 +43,17 @@ services:
|
||||
JWTTokenSecret: ${LADOSE_JWT_SECRET:-dev-only-secret-not-for-any-deployed-environment}
|
||||
ApiKey__SmashApiKey: ${LADOSE_SMASH_API_KEY:-}
|
||||
ApiKey__ChallongeApiKey: ${LADOSE_CHALLONGE_API_KEY:-}
|
||||
# Rankings export to Google Sheets. "Disabled" out of the box, so the button
|
||||
# reports "not configured" rather than failing. Set Writer=Logging to see the
|
||||
# payload in `docker compose logs -f api` without touching a spreadsheet.
|
||||
GoogleSheets__Writer: ${LADOSE_SHEETS_WRITER:-Disabled}
|
||||
GoogleSheets__SpreadsheetId: ${LADOSE_SHEETS_SPREADSHEET_ID:-}
|
||||
GoogleSheets__ServiceAccount__CredentialsPath: ${LADOSE_SHEETS_SA_CREDENTIALS_PATH:-}
|
||||
volumes:
|
||||
# Where the service-account key lives, read-only. Compose creates ./secrets if it
|
||||
# is missing, so this is harmless when the export is Disabled or set to Logging.
|
||||
# git ignores the directory; put ladose-sheets-sa.json in it.
|
||||
- ./secrets:/run/secrets:ro
|
||||
ports:
|
||||
# Container side is pinned at 5000: Program.cs reads AllowedHosts/Port straight
|
||||
# from appsettings.json, through a ConfigurationBuilder that ignores env vars.
|
||||
@@ -78,3 +97,47 @@ services:
|
||||
- node_modules/
|
||||
- build/
|
||||
- .svelte-kit/
|
||||
|
||||
bot:
|
||||
profiles:
|
||||
# Opt-in: `docker compose up` without --profile bot leaves this service alone.
|
||||
# LADOSE_DISCORD_TOKEN has no usable default — without one the bot exits on the
|
||||
# first connection attempt and `restart` below turns that into a loop — so it does
|
||||
# not belong in the default `up` the way the API and the webapp do.
|
||||
- bot
|
||||
build:
|
||||
# Context is LaDOSE.Src, shared with the api service: the bot references
|
||||
# LaDOSE.REST/LaDOSE.DTO and Libraries/ChallongeCSharpDriver.dll, none of which are
|
||||
# reachable from a context rooted at LaDOSE.DiscordBot.
|
||||
context: ./LaDOSE.Src
|
||||
dockerfile: LaDOSE.DiscordBot/Dockerfile
|
||||
# No BUILD_CONFIGURATION override: unlike the API, nothing in this project is
|
||||
# compiled out of a Release build, so the Dockerfile's Release default is right.
|
||||
environment:
|
||||
# Program.cs reads settings.json and never looks at the environment, so
|
||||
# LaDOSE.DiscordBot/docker-entrypoint.sh renders that file from these five values at
|
||||
# container start. Setting LADOSE_DISCORD_TOKEN is what switches the rendering on.
|
||||
LADOSE_DISCORD_TOKEN: ${LADOSE_DISCORD_TOKEN:-}
|
||||
# Same key the api service gets — one bot and one API against the same Challonge
|
||||
# account.
|
||||
LADOSE_CHALLONGE_API_KEY: ${LADOSE_CHALLONGE_API_KEY:-}
|
||||
# Resolved *inside* the container, unlike the webapp's LADOSE_API_BASE_URL, so the
|
||||
# compose service name is the right answer and the host port mapping is irrelevant.
|
||||
LADOSE_BOT_REST_URL: ${LADOSE_BOT_REST_URL:-http://api:5000}
|
||||
# Credentials of the LaDOSE.Api account the bot logs in as (RestService.Connect).
|
||||
LADOSE_BOT_REST_USER: ${LADOSE_BOT_REST_USER:-}
|
||||
LADOSE_BOT_REST_PASSWORD: ${LADOSE_BOT_REST_PASSWORD:-}
|
||||
depends_on:
|
||||
# Ordering only, and only useful for the commands that call the API. The bot's own
|
||||
# startup does not touch it: WebService swallows a failed Connect with "Unable to
|
||||
# contact services", so a late API is recoverable.
|
||||
- api
|
||||
restart: unless-stopped
|
||||
develop:
|
||||
watch:
|
||||
- action: rebuild
|
||||
path: ./LaDOSE.Src
|
||||
ignore:
|
||||
- LaDOSE.WebApp/
|
||||
- "**/bin/"
|
||||
- "**/obj/"
|
||||
|
||||
Reference in New Issue
Block a user