30 lines
898 B
YAML
30 lines
898 B
YAML
services:
|
|
postgres:
|
|
image: postgres:18-bookworm@sha256:bbf83594798e144bff365a9c191c5d779f181fb3135902064ab8ff11918020fc
|
|
restart: unless-stopped
|
|
command: [postgres, -c, timezone=UTC, -c, log_timezone=UTC]
|
|
environment:
|
|
TZ: UTC
|
|
POSTGRES_DB: codex_proxy
|
|
POSTGRES_USER: codex_proxy
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
POSTGRES_INITDB_ARGS: --auth-local=scram-sha-256 --auth-host=scram-sha-256
|
|
# PostgreSQL 18 的卷挂载根目录与旧版不同。
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql
|
|
healthcheck:
|
|
test: [CMD-SHELL, pg_isready -U codex_proxy -d codex_proxy]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: '10m'
|
|
max-file: '5'
|
|
|
|
volumes:
|
|
postgres-data:
|