added postgres to the stack
This commit is contained in:
@@ -6,10 +6,14 @@
|
||||
# Keine echten Secrets committen.
|
||||
# =====================================================================
|
||||
|
||||
# PostgreSQL
|
||||
# In Coolify am besten die interne URL deiner bestehenden Postgres-DB verwenden.
|
||||
# Beispiel: postgresql://USER:PASSWORD@HOST:5432/kita_planer?schema=public
|
||||
DATABASE_URL="postgresql://[USER]:[PASSWORD]@[HOST]:[PORT]/[DATABASE]?schema=public"
|
||||
# PostgreSQL im Coolify-Compose-Stack
|
||||
POSTGRES_DB="kita_planer"
|
||||
POSTGRES_USER="kita_planer"
|
||||
POSTGRES_PASSWORD="[GENERATE_ME]"
|
||||
|
||||
# pgAdmin im Coolify-Compose-Stack
|
||||
PGADMIN_DEFAULT_EMAIL="[admin@deine-domain.de]"
|
||||
PGADMIN_DEFAULT_PASSWORD="[GENERATE_ME]"
|
||||
|
||||
# Auth.js / NextAuth
|
||||
# Generieren mit: openssl rand -base64 32
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-kita_planer}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-kita_planer}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
|
||||
volumes:
|
||||
- kita_planer_postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
@@ -12,7 +27,7 @@ services:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
HOSTNAME: 0.0.0.0
|
||||
DATABASE_URL: ${DATABASE_URL:?}
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-kita_planer}:${POSTGRES_PASSWORD:?}@postgres:5432/${POSTGRES_DB:-kita_planer}?schema=public
|
||||
AUTH_SECRET: ${AUTH_SECRET:?}
|
||||
AUTH_URL: ${AUTH_URL:?}
|
||||
NEXTAUTH_URL: ${NEXTAUTH_URL:?}
|
||||
@@ -26,15 +41,30 @@ services:
|
||||
UPLOAD_DIR: /app/uploads/announcements
|
||||
volumes:
|
||||
- kita_planer_uploads:/app/uploads
|
||||
networks:
|
||||
- default
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "3000"
|
||||
restart: unless-stopped
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:?}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:?}
|
||||
PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: "True"
|
||||
PGADMIN_CONFIG_CONSOLE_LOG_LEVEL: 30
|
||||
volumes:
|
||||
kita_planer_uploads:
|
||||
- kita_planer_pgadmin_data:/var/lib/pgadmin
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "80"
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
coolify:
|
||||
external: true
|
||||
volumes:
|
||||
kita_planer_postgres_data:
|
||||
kita_planer_uploads:
|
||||
kita_planer_pgadmin_data:
|
||||
|
||||
Reference in New Issue
Block a user