infra: Docker Compose 开发环境(PostgreSQL + Redis)
- docker-compose.dev.yml: PostgreSQL 17 + Redis 7 服务编排 - init.sql: auth 模块表结构 + 默认角色 + 超级管理员 - redis.conf: 开发环境 Redis 配置 - dev-setup.sh: 一键启动开发环境脚本 - .gitignore: 项目全局忽略规则 Made-with: Cursor
This commit is contained in:
39
deploy/docker-compose.dev.yml
Normal file
39
deploy/docker-compose.dev.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
container_name: echochat-postgres
|
||||
environment:
|
||||
POSTGRES_DB: echochat
|
||||
POSTGRES_USER: echochat
|
||||
POSTGRES_PASSWORD: echochat_dev_2026
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U echochat"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: echochat-redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
- ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
|
||||
command: redis-server /usr/local/etc/redis/redis.conf
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
redisdata:
|
||||
Reference in New Issue
Block a user