# Docker Compose für Full Stack Application version: "3.8" services: app: image: ${APP_IMAGE:-fullstack-app:latest} container_name: ${APP_CONTAINER_NAME:-fullstack-app} restart: unless-stopped environment: - NODE_ENV=${NODE_ENV:-production} - DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/appdb} - JWT_SECRET=${JWT_SECRET:-your-jwt-secret-change-this} networks: - app-network depends_on: postgres: condition: service_healthy ports: - "${APP_PORT:-3000}:3000" postgres: image: postgres:15-alpine container_name: ${POSTGRES_CONTAINER_NAME:-postgres-db} restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-appdb} POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} volumes: - postgres_data:/var/lib/postgresql/data networks: - app-network ports: - "${POSTGRES_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"] interval: 10s timeout: 5s retries: 5 networks: app-network: driver: bridge volumes: postgres_data: driver: local