This commit is contained in:
2026-06-14 18:00:43 +02:00
parent 4be49200f0
commit cd0d554fef
37 changed files with 7727 additions and 0 deletions
+121
View File
@@ -0,0 +1,121 @@
# ==========================================
# GardenPlan Docker Compose (Development)
# ==========================================
services:
# --------------------------------------------------
# PHP-FPM Symfony Backend
# --------------------------------------------------
php-fpm:
build:
context: ./Infra/php-fpm
dockerfile: Dockerfile
container_name: gardenplan-php-fpm
restart: unless-stopped
working_dir: /var/www/html
volumes:
- ./Backend:/var/www/html:z
- phpsocket:/var/run/php
networks:
- gardenplan-network
depends_on:
database:
condition: service_healthy
# --------------------------------------------------
# Nginx Webserver & Reverse Proxy
# --------------------------------------------------
nginx:
image: nginx:1.25-alpine
container_name: gardenplan-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Infra/nginx/default.conf:/etc/nginx/conf.d/default.conf:z
- ./Backend/public:/var/www/html/public:ro,z
- nginx_cache:/var/cache/nginx
networks:
- gardenplan-network
depends_on:
- php-fpm
# --------------------------------------------------
# PostgreSQL Datenbank
# --------------------------------------------------
database:
image: postgres:16-alpine
container_name: gardenplan-database
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB:-gardenplan}
POSTGRES_USER: ${POSTGRES_USER:-symfony}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
- ./Infra/database/init:/docker-entrypoint-initdb.d:z
networks:
- gardenplan-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-symfony} -d ${POSTGRES_DB:-gardenplan}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# --------------------------------------------------
# Keycloak Identity Provider (OIDC / JWT)
# --------------------------------------------------
keycloak:
image: quay.io/keycloak/keycloak:24.0
container_name: gardenplan-keycloak
restart: unless-stopped
ports:
- "8080:8080"
environment:
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-adminsecret}
KC_DATABASE: postgres
KC_DATABASE_URL: jdbc:postgresql://database:5432/keycloak_db
KC_DATABASE_USERNAME: keycloak
KC_DATABASE_PASSWORD: keycloak_secret
KC_HTTP_RELATIVE_PATH: /auth
KC_HOSTNAME: localhost
KC_HOSTNAME_STRICT: "false"
KC_FEATURES: scripts
command: start-dev
volumes:
- ./Infra/keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:z
networks:
- gardenplan-network
depends_on:
database:
condition: service_healthy
# --------------------------------------------------
# Keycloak Database (getrennt, falls gewünscht)
# Hier verwenden wir die Haupt-DB mit eigenem Schema
# Alternative: extra DB-Container hier vereinfacht
# --------------------------------------------------
# ==========================================
# Volumes
# ==========================================
volumes:
postgres_data:
driver: local
phpsocket:
driver: local
nginx_cache:
driver: local
# ==========================================
# Networks
# ==========================================
networks:
gardenplan-network:
driver: bridge