Fix Dokploy Bad Gateway: panel-first compose and stable boot
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+23
-20
@@ -1,21 +1,5 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-vpn}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vpn}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- vpn_net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
# IMPORTANT for Dokploy: attach domain to this service, port 8000
|
||||
panel:
|
||||
build:
|
||||
context: .
|
||||
@@ -24,6 +8,8 @@ services:
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
expose:
|
||||
- "8000"
|
||||
ports:
|
||||
- "${PANEL_PORT:-8000}:8000"
|
||||
environment:
|
||||
@@ -39,7 +25,7 @@ services:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-vpn}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vpn}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
||||
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-vpn}:${POSTGRES_PASSWORD:-vpn}@postgres:5432/${POSTGRES_DB:-vpn_panel}
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://vpn:vpn@postgres:5432/vpn_panel}
|
||||
|
||||
PUBLIC_HOST: ${PUBLIC_HOST:-127.0.0.1}
|
||||
PUBLIC_PORT: ${PUBLIC_PORT:-51820}
|
||||
@@ -62,8 +48,25 @@ services:
|
||||
test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 20s
|
||||
retries: 10
|
||||
start_period: 90s
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER:-vpn}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vpn}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- vpn_net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
networks:
|
||||
vpn_net:
|
||||
|
||||
Reference in New Issue
Block a user