owpengram-server/deploy/docker-compose.yml
2026-06-04 01:37:39 +08:00

48 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# telesrv 第一阶段三方依赖(开发用)。
#
# 启动: docker compose up -d
# 状态: docker compose ps
# 关停: docker compose down (保留数据卷)
# 清空: docker compose down -v (连数据卷一起删,重置 schema/数据)
#
# server 端连接串见 internal/config/config.go 的默认值localhost:5432 / localhost:6399
name: telesrv
services:
postgres:
image: postgres:17-alpine
container_name: telesrv-postgres
environment:
POSTGRES_DB: telesrv
POSTGRES_USER: telesrv
POSTGRES_PASSWORD: telesrv
TZ: UTC
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U telesrv -d telesrv"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: telesrv-redis
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6399:6379" # 宿主 6379 常被其他项目占用telesrv 对外用 6399容器内仍 6379
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
volumes:
pgdata:
redisdata: