Files
Speisekarte/docker-compose.yml
T

64 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================
# Speisekarte – Docker-Setup
#
# Produktion (App + lokale PostgreSQL-Kopie):
# docker compose --env-file .env.local up -d --build
#
# Entwicklung (Dev-Server mit Hot-Reload, kein lokales Node nötig):
# docker compose --env-file .env.local --profile dev up dev
#
# Die --env-file-Angabe speist NEXT_PUBLIC_* in den Build und
# SUPABASE_SERVICE_ROLE_KEY in die Laufzeit-Umgebung.
# =============================================================
services:
# ---------- Next.js-App (Produktions-Build) ----------
app:
build:
context: .
args:
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
environment:
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
ports:
- "3000:3000"
restart: unless-stopped
# ---------- Lokale PostgreSQL-Kopie (Ablage/Auswertungen) ----------
# Beim ersten Start werden die Skripte aus supabase/local
# automatisch in alphabetischer Reihenfolge eingespielt.
db:
image: postgres:17-alpine
environment:
POSTGRES_DB: speisekarte
POSTGRES_PASSWORD: ${LOCAL_PG_PASSWORD:-speisekarte}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./supabase/local:/docker-entrypoint-initdb.d:ro
restart: unless-stopped
# ---------- Dev-Server (nur mit --profile dev) ----------
dev:
image: node:24-alpine
profiles: ["dev"]
working_dir: /app
command: sh -c "npm install && npm run dev"
environment:
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
ports:
- "3000:3000"
volumes:
- .:/app
- dev_node_modules:/app/node_modules
volumes:
pgdata:
dev_node_modules: