feat: introduce database as a persistent storage for settings and history
refactor: arrange persistence layer as a port-adapter schema
This commit is contained in:
38 files changed
+539
-269
No files matched your search
+28
-1
@@ -1,5 +1,21 @@
|
||||
services:
|
||||
# Bot Discorda wraz z API i panelem webowym serwowanym przez FastAPI.
|
||||
database:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-zyrarbot}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-zyrarbot}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-zyrarbot}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5432:5432/tcp"
|
||||
discord-bot:
|
||||
build:
|
||||
context: .
|
||||
@@ -8,10 +24,21 @@ services:
|
||||
environment:
|
||||
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
||||
- GUILD_ID=${GUILD_ID:-}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-zyrarbot}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-zyrarbot}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-zyrarbot}
|
||||
- POSTGRES_HOST=database
|
||||
- POSTGRES_PORT=5432
|
||||
- PYTHONUNBUFFERED=1
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- ./config:/app/config
|
||||
- ./uploads:/app/uploads
|
||||
ports:
|
||||
- "80:8000"
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in new issue
Block a user