mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-22 23:18:05 +03:00
* if it hurts to breathe (open a window) * clocked it. * must sleep tonight, sorry * feat: leaderboard now shows #1 if you're #1 even in ties
161 lines
4.5 KiB
YAML
161 lines
4.5 KiB
YAML
services:
|
|
tachi-mongo:
|
|
container_name: tachi-mongo
|
|
command: "--config /etc/mongod.conf"
|
|
image: mongo:5
|
|
restart: unless-stopped
|
|
ports:
|
|
- "27017:27017"
|
|
volumes:
|
|
- tachi-volume:/data/db
|
|
- "./dev/mongod.conf:/etc/mongod.conf"
|
|
|
|
tachi-redis:
|
|
container_name: tachi-redis
|
|
command: redis-server --save 60 1 --loglevel warning
|
|
image: redis:7.4.1
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- tachi-redis:/data
|
|
tachi-postgres:
|
|
container_name: tachi-postgres
|
|
image: postgres:18
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
# Dev observability: pg_stat_statements + slow-query logging + auto_explain plans.
|
|
# Recreate the container (or bump volume) after changing these; existing DBs: run
|
|
# CREATE EXTENSION pg_stat_statements; once if missing.
|
|
command:
|
|
- postgres
|
|
- -c
|
|
- shared_preload_libraries=pg_stat_statements,auto_explain
|
|
- -c
|
|
- pg_stat_statements.track=all
|
|
- -c
|
|
- log_min_duration_statement=100
|
|
- -c
|
|
- log_line_prefix=%m [%p] %q%u@%d
|
|
- -c
|
|
- auto_explain.log_min_duration=500
|
|
- -c
|
|
- auto_explain.log_analyze=on
|
|
- -c
|
|
- auto_explain.log_buffers=on
|
|
environment:
|
|
POSTGRES_USER: tachi
|
|
POSTGRES_PASSWORD: tachi
|
|
POSTGRES_DB: tachi
|
|
volumes:
|
|
- tachi-postgres:/var/lib/postgresql
|
|
- "./dev/postgres-init.sql:/docker-entrypoint-initdb.d/init.sql"
|
|
tachi-s3:
|
|
container_name: tachi-s3
|
|
image: quay.io/minio/minio:RELEASE.2024-10-29T16-01-48Z
|
|
environment:
|
|
MINIO_ROOT_USER: minio
|
|
MINIO_ROOT_PASSWORD: password
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
volumes:
|
|
- tachi-minio:/data
|
|
entrypoint: /usr/bin/minio server /data --console-address=':9001'
|
|
|
|
# Local SMTP capture + web UI (http://localhost:8025). Server uses tachi-mailpit:1025 via env.
|
|
tachi-mailpit:
|
|
container_name: tachi-mailpit
|
|
image: axllent/mailpit:v1.29.7
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8025:8025"
|
|
- "1025:1025"
|
|
|
|
tachi-dev:
|
|
user: "1000:1000"
|
|
tty: true
|
|
container_name: tachi-dev
|
|
depends_on:
|
|
- tachi-s3
|
|
- tachi-mailpit
|
|
build:
|
|
dockerfile: Dockerfile.dev
|
|
ports:
|
|
- "8080:8080" # server
|
|
- "3000:3000" # client
|
|
- "3001:3001" # docs
|
|
- "9779:9779" # metrics
|
|
volumes:
|
|
- ./:/tachi
|
|
# Mount your home files under your-pc, so you can easily access them
|
|
- ~:/host-pc
|
|
# keep node_modules inside the container, not on the host mount
|
|
- /tachi/node_modules/
|
|
- /tachi/.bun
|
|
|
|
# Local observability (Grafana + Prometheus + Alloy). Grafana UI: http://localhost:3005
|
|
# Alloy scrapes the API metrics endpoint at tachi-dev:9779 and remote-writes into Prometheus.
|
|
tachi-grafana:
|
|
container_name: tachi-grafana
|
|
image: grafana/grafana:12.4.2
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- tachi-prometheus
|
|
ports:
|
|
- "3005:3000"
|
|
environment:
|
|
GF_SECURITY_ADMIN_USER: tachi
|
|
GF_SECURITY_ADMIN_PASSWORD: tachi
|
|
GF_USERS_ALLOW_SIGN_UP: "false"
|
|
GF_SERVER_HTTP_ADDR: 0.0.0.0
|
|
GF_SERVER_HTTP_PORT: "3000"
|
|
GF_SERVER_ROOT_URL: http://localhost:3005
|
|
volumes:
|
|
- tachi-grafana:/var/lib/grafana
|
|
- ./dev/observability/grafana/provisioning:/etc/grafana/provisioning
|
|
- ./dev/observability/grafana/dashboards:/var/lib/grafana/dashboards
|
|
|
|
tachi-prometheus:
|
|
container_name: tachi-prometheus
|
|
image: prom/prometheus:v3.11.0
|
|
restart: unless-stopped
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
- --storage.tsdb.path=/prometheus
|
|
- --web.enable-lifecycle
|
|
- --web.enable-remote-write-receiver
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- tachi-prometheus:/prometheus
|
|
- ./dev/observability/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
|
|
tachi-alloy:
|
|
container_name: tachi-alloy
|
|
image: grafana/alloy:v1.15.0
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- tachi-prometheus
|
|
command:
|
|
- run
|
|
- --server.http.listen-addr=0.0.0.0:12345
|
|
- --storage.path=/var/lib/alloy/data
|
|
- /etc/alloy/config.alloy
|
|
ports:
|
|
- "12345:12345"
|
|
# Writable WAL path (named volumes are often root-owned; Alloy runs non-root and can crash-loop).
|
|
tmpfs:
|
|
- /var/lib/alloy/data
|
|
volumes:
|
|
- ./dev/observability/alloy-config.alloy:/etc/alloy/config.alloy
|
|
|
|
volumes:
|
|
tachi-volume:
|
|
tachi-redis:
|
|
tachi-logs:
|
|
tachi-postgres:
|
|
tachi-minio:
|
|
tachi-grafana:
|
|
tachi-prometheus: |