## Docker Compose stack for Symfony app ## - php: PHP-FPM container that runs Symfony and Composer ## - nginx: Frontend web server proxying PHP to php-fpm ## - db: Postgres database for Doctrine ## - pgadmin: Optional UI to inspect the database services: # php: # # Build multi-stage image defined in docker/php/Dockerfile # build: # context: . # dockerfile: docker/php/Dockerfile # target: dev # args: # - APP_ENV=dev # container_name: php # restart: unless-stopped # #environment: # # Doctrine DATABASE_URL consumed by Symfony/Doctrine # #DATABASE_URL: ${DATABASE_URL:-postgresql://${POSTGRES_USER:-symfony}:${POSTGRES_PASSWORD:-symfony}@db:5432/${POSTGRES_DB:-symfony}?serverVersion=16&charset=utf8} # volumes: # # Mount only source and config; vendors are installed in-container # - ./bin:/var/www/html/bin # - ./config:/var/www/html/config # - ./migrations:/var/www/html/migrations # - ./public:/var/www/html/public # - ./templates:/var/www/html/templates # - ./src:/var/www/html/src # - ./var:/var/www/html/var # - ./.env:/var/www/html/.env:ro # - ./vendor:/var/www/html/vendor # # Keep composer manifests on host for version control # - ./composer.json:/var/www/html/composer.json # - ./composer.lock:/var/www/html/composer.lock # - ./symfony.lock:/var/www/html/symfony.lock # # Speed up composer installs by caching download artifacts # - composer_cache:/tmp/composer # healthcheck: # test: ["CMD-SHELL", "php -v || exit 1"] # interval: 10s # timeout: 3s # retries: 5 # depends_on: # - db tonehaus: image: tonehaus/tonehaus:dev-arm64 container_name: tonehaus restart: unless-stopped volumes: - ./.env:/var/www/html/.env:ro - sqlite_data:/var/www/html/var/data ports: - "8085:8080" env_file: - .env healthcheck: test: ["CMD", "curl", "-f", "http://localhost:80/healthz"] interval: 10s timeout: 3s retries: 5 # nginx: # image: nginx:alpine # container_name: nginx # ports: # - "8000:80" # volumes: # # Serve built assets and front controller from Symfony public dir # - ./public:/var/www/html/public # # Custom vhost with PHP FastCGI proxy # - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf # depends_on: # - tonehaus # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:80/healthz"] # interval: 10s # timeout: 3s # retries: 5 # db: # image: postgres:16-alpine # container_name: postgres # restart: unless-stopped # environment: # POSTGRES_DB: ${POSTGRES_DB:-symfony} # POSTGRES_USER: ${POSTGRES_USER:-symfony} # POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-symfony} # ports: # - 5432:5432 # volumes: # - db_data:/var/lib/postgresql/data # healthcheck: # test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-symfony} -d ${POSTGRES_DB:-symfony}"] # interval: 10s # timeout: 5s # retries: 10 # pgadmin: # image: dpage/pgadmin4 # container_name: pgadmin # environment: # PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@example.com} # PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-password} # ports: # - "8081:80" # volumes: # - pgadmin_data:/var/lib/pgadmin # depends_on: # - db volumes: sqlite_data: # composer_cache: # pgadmin_data: