chore: 初始化项目骨架 — 数据模块依赖配置、TimescaleDB 建表脚本、Docker Compose 编排

This commit is contained in:
Rekey
2026-06-06 19:56:01 +08:00
commit 10e13ae8da
7 changed files with 2120 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
services:
timescaledb:
image: timescale/timescaledb-ha:pg17.10-ts2.27.1
container_name: trade-timescaledb
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_DB: trade
POSTGRES_USER: trader
POSTGRES_PASSWORD: fucketh
volumes:
- ./db/pgsql:/var/lib/postgresql
- ./data/init-db:/docker-entrypoint-initdb.d # 自动执行建表 SQL
command: >
-c shared_buffers=1GB
-c effective_cache_size=3GB
-c maintenance_work_mem=256MB
-c work_mem=64MB
-c wal_buffers=64MB
-c random_page_cost=1.1
-c effective_io_concurrency=200
-c max_connections=50
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trader -d trade"]
interval: 10s
timeout: 5s
retries: 5