fix
This commit is contained in:
@@ -1,32 +1,73 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
# ======== PROD ========
|
||||
mail-admin:
|
||||
# Nur aktiv, wenn Profil 'prod' gesetzt ist
|
||||
profiles: ["prod"]
|
||||
container_name: mail-s3-admin
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
# Next.js & DB
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://postgres:fiesta@postgres:5432/mydb
|
||||
# Deine App-Variablen
|
||||
APP_PASSWORD: ${APP_PASSWORD}
|
||||
PROCESSED_META_KEY: ${PROCESSED_META_KEY}
|
||||
PROCESSED_META_VALUE: ${PROCESSED_META_VALUE}
|
||||
# Optional hilfreich:
|
||||
NEXT_TELEMETRY_DISABLED: "1"
|
||||
ports:
|
||||
- "3060:3000"
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- APP_PASSWORD=${APP_PASSWORD}
|
||||
- PROCESSED_META_KEY=${PROCESSED_META_KEY}
|
||||
- PROCESSED_META_VALUE=${PROCESSED_META_VALUE}
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
- .:/app # Mount local code for dev changes
|
||||
command: npm run dev # Run dev mode in container
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
# ======== DEV ========
|
||||
mail-admin-dev:
|
||||
profiles: ["dev"]
|
||||
container_name: mail-s3-admin-dev
|
||||
image: node:18-alpine
|
||||
working_dir: /app
|
||||
command: sh -c "npm install && npm run dev"
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
DATABASE_URL: postgresql://postgres:fiesta@postgres:5432/mydb
|
||||
APP_PASSWORD: ${APP_PASSWORD}
|
||||
PROCESSED_META_KEY: ${PROCESSED_META_KEY}
|
||||
PROCESSED_META_VALUE: ${PROCESSED_META_VALUE}
|
||||
NEXT_TELEMETRY_DISABLED: "1"
|
||||
ports:
|
||||
- "3060:3000"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- .:/app:cached # Quellcode aus dem Host
|
||||
- /app/node_modules # Anonymes Volume: verhindert Konflikte mit Host
|
||||
restart: unless-stopped
|
||||
|
||||
# ======== POSTGRES (geteilt) ========
|
||||
postgres:
|
||||
container_name: mail-s3-admin-db
|
||||
image: postgres:latest
|
||||
restart: always
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
||||
POSTGRES_PASSWORD: fiesta
|
||||
POSTGRES_DB: mydb
|
||||
ports:
|
||||
- "5434:5432"
|
||||
- "5434:5432" # optional, nur nötig wenn du lokal via Host-Port zugreifen willst
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d mydb || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
postgres-data:
|
||||
|
||||
Reference in New Issue
Block a user