From a70a5445eb3bc8f14d6b2fb5d5b4702f2e5ae19f Mon Sep 17 00:00:00 2001 From: Montech Date: Tue, 15 Sep 2026 17:32:23 +0330 Subject: [PATCH] Fix api build --- .env.example | 7 +++++++ docker-compose.yml | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 69888ec..3c66284 100644 --- a/.env.example +++ b/.env.example @@ -2,3 +2,10 @@ # (no longer a Docker build arg — images only copy pre-built files). # VITE_CLIENT_PUBLIC_URL=https://wheel.example.com VITE_CLIENT_PUBLIC_URL=http://localhost:5174 + +# Docker / Dokploy — API DATABASE_URL is derived from these (do not set DATABASE_URL). +# Postgres only applies POSTGRES_PASSWORD on first volume init; changing it later +# does nothing unless you recreate the pg_data volume. +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgrespassword +POSTGRES_DB=lucky_wheel diff --git a/docker-compose.yml b/docker-compose.yml index d97cd8b..7af1136 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,7 +43,10 @@ services: redis: condition: service_healthy environment: - - DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgrespassword@postgres:5432/lucky_wheel?schema=public} + # Always built from the same POSTGRES_* vars as the db service. + # A separate DATABASE_URL in Dokploy (e.g. password "postgres" from another + # stack) was authenticating as user postgres with the wrong password (P1000). + - DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgrespassword}@postgres:5432/${POSTGRES_DB:-lucky_wheel}?schema=public - PORT=${PORT:-3000} - NODE_ENV=production - REDIS_HOST=redis