fix: env_file 改为相对路径,解决 CI 容器无法读取 /opt/camtalk/.env 的问题

This commit is contained in:
hhs
2026-06-20 19:29:12 +08:00
parent 92e6636d05
commit fe5ac20a1f
3 changed files with 56 additions and 36 deletions

View File

@@ -18,7 +18,7 @@ services:
dockerfile: Dockerfile
container_name: camtalk-backend
env_file:
- /opt/camtalk/.env
- .env
environment:
# 三级存储配置(敏感信息通过 env_file 注入)
- CAMTALK_STORAGE_REDIS_ENABLED=${CAMTALK_STORAGE_REDIS_ENABLED:-true}
@@ -38,7 +38,7 @@ services:
image: docker.m.daocloud.io/library/postgres:15-alpine
container_name: camtalk-postgres
env_file:
- /opt/camtalk/.env
- .env
environment:
POSTGRES_DB: camtalk
volumes:
@@ -57,7 +57,7 @@ services:
image: docker.m.daocloud.io/library/redis:7-alpine
container_name: camtalk-redis
env_file:
- /opt/camtalk/.env
- .env
command: >
sh -c '
if [ -n "$$CAMTALK_REDIS_PASSWORD" ]; then