使用 pg 替换 sql
This commit is contained in:
+20
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user