Skip to content

Commit

Permalink
chore: update docker-compose.yml (songquanpeng#189)
Browse files Browse the repository at this point in the history
去除 Redis 服务的 ports 配置,只允许 Docker Compose 启动的服务才可以访问Redis,不会暴露到宿主机上也不会和宿主机产生端口冲突;同时也提升安全性。
  • Loading branch information
mrhaoji authored Jun 22, 2023
1 parent c671730 commit c893d04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ services:
- ./logs:/app/logs
environment:
- SQL_DSN=root:123456@tcp(host.docker.internal:3306)/one-api # 修改此行,或注释掉以使用 SQLite 作为数据库
- REDIS_CONN_STRING=redis://redis:6379
- REDIS_CONN_STRING=redis://redis
- SESSION_SECRET=random_string # 修改为随机字符串
- TZ=Asia/Shanghai
# - SYNC_FREQUENCY=60 # 多机部署时从节点取消注释该行
# - FRONTEND_BASE_URL=https://openai.justsong.cn # 多机部署时从节点取消注释该行
depends_on:
- redis
healthcheck:
test: [ "CMD-SHELL", "curl -s http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk '{print $2}' | grep 'true'" ]
interval: 30s
Expand All @@ -28,5 +30,3 @@ services:
image: redis:latest
container_name: redis
restart: always
ports:
- "6379:6379"

0 comments on commit c893d04

Please sign in to comment.