Fix Dokploy Bad Gateway: drop required .env and add app healthcheck.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+26
-9
@@ -3,36 +3,53 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: vpn-panel
|
||||
restart: unless-stopped
|
||||
# Dokploy Traefik → этот порт. В UI домена укажите service=app, port=8080
|
||||
ports:
|
||||
- "${APP_PORT:-8080}:8080"
|
||||
env_file:
|
||||
- .env
|
||||
expose:
|
||||
- "8080"
|
||||
environment:
|
||||
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
|
||||
APP_PORT: ${APP_PORT:-8080}
|
||||
PORT: ${APP_PORT:-8080}
|
||||
APP_SECRET: ${APP_SECRET:-change-me-to-a-long-random-secret-key}
|
||||
APP_ENV: ${APP_ENV:-production}
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@panel.local}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-Admin123!ChangeMe}
|
||||
ADMIN_NAME: ${ADMIN_NAME:-Administrator}
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_PORT: "5432"
|
||||
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-vpn_admin}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-VpnDb_Secure_Pass_17}
|
||||
DATABASE_URL: postgres://${POSTGRES_USER:-vpn_admin}:${POSTGRES_PASSWORD:-VpnDb_Secure_Pass_17}@postgres:5432/${POSTGRES_DB:-vpn_panel}?sslmode=disable
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
start_period: 40s
|
||||
networks:
|
||||
- vpn-net
|
||||
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
container_name: vpn-panel-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-vpn_panel}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-vpn_admin}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-VpnDb_Secure_Pass_17}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
networks:
|
||||
- vpn-net
|
||||
|
||||
|
||||
Reference in New Issue
Block a user