mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-10 22:01:16 +00:00
Merge pull request #2 from xCyanGrizzly/copilot/fix-redeployment-issues
fix: Portainer redeployment fails when Telegram env vars are absent
This commit is contained in:
@@ -3,6 +3,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
pull_policy: build
|
||||
ports:
|
||||
- "${APP_PORT:-3000}:3000"
|
||||
environment:
|
||||
@@ -34,10 +35,11 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: worker/Dockerfile
|
||||
pull_policy: build
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-dragons}:${POSTGRES_PASSWORD:-stash}@db:5432/${POSTGRES_DB:-dragonsstash}
|
||||
- TELEGRAM_API_ID=${TELEGRAM_API_ID:?Set TELEGRAM_API_ID in .env}
|
||||
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH:?Set TELEGRAM_API_HASH in .env}
|
||||
- TELEGRAM_API_ID=${TELEGRAM_API_ID:-}
|
||||
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH:-}
|
||||
- WORKER_INTERVAL_MINUTES=${WORKER_INTERVAL_MINUTES:-60}
|
||||
- WORKER_TEMP_DIR=/tmp/zips
|
||||
- TDLIB_STATE_DIR=/data/tdlib
|
||||
@@ -65,11 +67,12 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: bot/Dockerfile
|
||||
pull_policy: build
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-dragons}:${POSTGRES_PASSWORD:-stash}@db:5432/${POSTGRES_DB:-dragonsstash}
|
||||
- BOT_TOKEN=${BOT_TOKEN:?Set BOT_TOKEN in .env}
|
||||
- TELEGRAM_API_ID=${TELEGRAM_API_ID:?Set TELEGRAM_API_ID in .env}
|
||||
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH:?Set TELEGRAM_API_HASH in .env}
|
||||
- BOT_TOKEN=${BOT_TOKEN:-}
|
||||
- TELEGRAM_API_ID=${TELEGRAM_API_ID:-}
|
||||
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH:-}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||
volumes:
|
||||
- tdlib_bot_state:/data/tdlib
|
||||
|
||||
@@ -13,6 +13,11 @@ async function main(): Promise<void> {
|
||||
log.info("DragonsStash Telegram Worker starting");
|
||||
log.info({ config: { ...config, databaseUrl: "***" } }, "Configuration loaded");
|
||||
|
||||
if (!config.telegramApiId || !config.telegramApiHash) {
|
||||
log.fatal("TELEGRAM_API_ID and TELEGRAM_API_HASH are both required");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Ensure temp directory exists
|
||||
await mkdir(config.tempDir, { recursive: true });
|
||||
await mkdir(config.tdlibStateDir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user