fix porduction docker file

This commit is contained in:
Kevin
2026-05-09 13:22:10 +08:00
parent 3413a28ebe
commit f0e37c5e76

View File

@@ -4,8 +4,7 @@ services:
image: m.daocloud.io/docker.io/pgvector/pgvector:pg17
container_name: life-echo-postgres
ports:
# 宿主机端口随机,避免与本机其它 PostgreSQL 冲突;查询: docker compose port postgres 5432
- "127.0.0.1::5432"
- "127.0.0.1:5432:5432" # 仅绑定 localhost通过 SSH 隧道访问
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
@@ -57,10 +56,10 @@ services:
dockerfile: Dockerfile
image: life-echo-api:latest
container_name: life-echo-api-prod
# 独立 Caddy 反代;绑定本机回环。未设置 LIFE_ECHO_API_HOST_PORT 时宿主机端口随机,避免与机上其它服务冲突
# 需固定端口时(例如 Caddyfile在 .env 设置 LIFE_ECHO_API_HOST_PORT=8000随机时查询: docker compose port api 8000
# 独立 Caddy(宿主机或其它 compose经 HTTPS 反代;绑定本机回环,避免与机上其它项目端口直接对公网
# 若与 Cosmetic 等共用主机且 8000 已被占用,在 .env 设置 LIFE_ECHO_API_HOST_PORT=其它端口并在 Caddyfile 中一致。
ports:
- "127.0.0.1:${LIFE_ECHO_API_HOST_PORT:-}:8000"
- "127.0.0.1:${LIFE_ECHO_API_HOST_PORT:-8000}:8000"
env_file:
- .env
environment: