79 lines
No EOL
2.3 KiB
YAML
79 lines
No EOL
2.3 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
dereth-tracker:
|
|
build: .
|
|
ports:
|
|
- "127.0.0.1:8765:8765"
|
|
depends_on:
|
|
- db
|
|
volumes:
|
|
- "./main.py:/app/main.py"
|
|
- "./db_async.py:/app/db_async.py"
|
|
- "./static:/app/static"
|
|
- "./alembic:/app/alembic"
|
|
- "./alembic.ini:/app/alembic.ini"
|
|
environment:
|
|
# Database connection URL for TimescaleDB (built from POSTGRES_PASSWORD)
|
|
DATABASE_URL: "postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/dereth"
|
|
# Override application settings as needed
|
|
DB_MAX_SIZE_MB: "${DB_MAX_SIZE_MB}"
|
|
DB_RETENTION_DAYS: "${DB_RETENTION_DAYS}"
|
|
DB_MAX_SQL_LENGTH: "${DB_MAX_SQL_LENGTH}"
|
|
DB_MAX_SQL_VARIABLES: "${DB_MAX_SQL_VARIABLES}"
|
|
DB_WAL_AUTOCHECKPOINT_PAGES: "${DB_WAL_AUTOCHECKPOINT_PAGES}"
|
|
SHARED_SECRET: "${SHARED_SECRET}"
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
db:
|
|
image: timescale/timescaledb:latest-pg14
|
|
container_name: dereth-db
|
|
environment:
|
|
POSTGRES_DB: dereth
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
|
|
volumes:
|
|
- timescale-data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: dereth-grafana
|
|
ports:
|
|
- "127.0.0.1:3000:3000"
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
# Grafana admin settings
|
|
GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}"
|
|
# Allow embedding Grafana dashboards in iframes
|
|
GF_SECURITY_ALLOW_EMBEDDING: "true"
|
|
GF_USERS_ALLOW_SIGN_UP: "false"
|
|
# Serve Grafana under /grafana path
|
|
GF_SERVER_ROOT_URL: "https://overlord.snakedesert.se/grafana"
|
|
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
|
|
# Postgres password for provisioning datasource
|
|
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
|
|
volumes:
|
|
# Provisioning directories for automated data source and dashboards
|
|
- ./grafana/provisioning:/etc/grafana/provisioning
|
|
- ./grafana/dashboards:/var/lib/grafana/dashboards
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
volumes:
|
|
timescale-data: |