使用 pg 替换 sql

This commit is contained in:
yml2213
2026-07-22 13:34:55 +08:00
parent 0c60f76af0
commit f9dc80e563
8 changed files with 101 additions and 24 deletions
+20 -1
View File
@@ -1,4 +1,19 @@
services:
postgres:
image: ${POSTGRES_IMAGE:-docker.m.daocloud.io/library/postgres:16-alpine}
environment:
- POSTGRES_USER=${POSTGRES_USER:-affiliate}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-affiliate_dev_password}
- POSTGRES_DB=${POSTGRES_DB:-affiliate_dash}
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: .
@@ -15,7 +30,7 @@ services:
environment:
- PORT=8080
- JWT_SECRET=${JWT_SECRET}
- DB_PATH=/data/app.db
- DATABASE_URL=postgres://${POSTGRES_USER:-affiliate}:${POSTGRES_PASSWORD:-affiliate_dev_password}@postgres:5432/${POSTGRES_DB:-affiliate_dash}?sslmode=disable
- GIN_MODE=${GIN_MODE:-release}
- OPEN_API_KEY=${OPEN_API_KEY}
- OPEN_API_SECRET=${OPEN_API_SECRET}
@@ -30,6 +45,9 @@ services:
interval: 30s
timeout: 10s
retries: 3
depends_on:
postgres:
condition: service_healthy
caddy:
build:
@@ -52,6 +70,7 @@ services:
restart: unless-stopped
volumes:
postgres-data:
backend-data:
caddy-data:
caddy-config: