fix(docker): use build args for NEXT_PUBLIC vars, remove host port exposure
- Dockerfile: replace hardcoded NEXT_PUBLIC env vars with ARG+ENV pattern so the same Dockerfile works for any environment (local dev, Dokploy prod) - docker-compose.yml: pass SUPABASE_ANON_KEY as build arg to Dockerfile - docker-compose.yml: remove DB port 5432 exposure (not needed on server, services communicate via Docker network)
This commit is contained in:
@@ -24,8 +24,6 @@ services:
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- "${DB_PORT:-5432}:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
||||
interval: 10s
|
||||
@@ -294,6 +292,10 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
NEXT_PUBLIC_SITE_URL: ${SITE_URL:-https://myeasycms.de}
|
||||
NEXT_PUBLIC_SUPABASE_URL: http://localhost:8000
|
||||
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY: ${SUPABASE_ANON_KEY}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
supabase-kong:
|
||||
|
||||
Reference in New Issue
Block a user