# Prompt 10: Symfony Testing and CI with Docker Help me write Symfony code to use Docker for local development Code requirements: 1. Use Docker Compose to run Symfony PHPUnit or Pest tests in an isolated container. 2. Add a dedicated service or command for running tests with the right environment and DB. 3. Integrate Docker setup into CI pipelines (GitHub Actions, GitLab CI, etc.). 4. Cache Composer and node_modules between test runs for speed. Additional considerations: 1. Document test run commands for developers. 2. Ensure DB is reset between test runs. 3. Provide examples for extending CI configuration. Expected output: A Dockerized Symfony project ready for local and CI test automation with documentation.
# Prompt 9: Symfony Local Development with Docker and Elasticsearch Help me write Symfony code to use Docker for local development Code requirements: 1. Add Elasticsearch service to `docker-compose.yml` for Symfony search development. 2. Configure Symfony `.env` or services to connect to local Elasticsearch. 3. Document indexing and searching setup in containers. 4. Provide troubleshooting steps for Elasticsearch startup and data sync. Additional considerations: 1. Optionally add Kibana for visualizing search indices. 2. Show how to reindex all data from Symfony command in Docker. 3. Handle data persistence for Elasticsearch volumes. Expected output: A Symfony Docker Compose setup with full Elasticsearch search stack for local dev.
# Prompt 8: Database Seeding and Migrations with Docker and Symfony Help me write Symfony code to use Docker for local development Code requirements: 1. Document running Symfony Doctrine migrations inside Docker containers. 2. Add support for database seeding using fixtures/bundle (e.g., DoctrineFixturesBundle). 3. Automate migrations and seeders as part of container startup or CI/CD pipeline. 4. Troubleshoot common issues (e.g., DB connection timing). Additional considerations: 1. Show how to reset and reseed the database easily in local dev. 2. Provide Docker Compose health checks for DB readiness. 3. Document workflows for new team members. Expected output: A Symfony Docker setup with streamlined database migration and seeding support.
# Prompt 7: Environment Variable Management in Symfony Docker Setup Help me write Symfony code to use Docker for local development Code requirements: 1. Use Docker Compose `environment` and `.env` files to manage configuration. 2. Load environment variables into Symfony via `docker-compose.yml` and `.env.local`. 3. Document secure handling of secrets (e.g., database passwords). 4. Show how to override variables per developer or branch. Additional considerations: 1. Avoid committing sensitive info to version control. 2. Recommend best practices for environment management in Docker. 3. Document environment variable priority in Docker/Symfony. Expected output: A documented, secure approach for environment variable management in Symfony Docker workflows.
# Prompt 6: Hot Reload and Live Development with Docker and Symfony Help me write Symfony code to use Docker for local development Code requirements: 1. Mount local project files into the PHP/Nginx containers for instant code reloads. 2. Set up Symfony Webpack Encore or Vite for hot reload of assets (JS/CSS) in Docker. 3. Document how to enable/disable cache for live development. 4. Optimize Docker Compose for quick rebuilds when dependencies change. Additional considerations: 1. Troubleshoot volume cache/sync issues on Mac/Windows. 2. Ensure hot reload works for both back-end and front-end. 3. Provide optional browser auto-refresh. Expected output: A Docker/Symfony workflow for fast, live local development with hot reload of code and assets.
# Prompt 5: Symfony Docker Environment with SSL/HTTPS Support Help me write Symfony code to use Docker for local development Code requirements: 1. Configure Nginx in Docker to serve Symfony with self-signed SSL certificates. 2. Automatically generate and mount certificates at container startup. 3. Update Symfony `.env` to use HTTPS URLs for local development. 4. Document how to trust local certificates on Mac/Windows/Linux. Additional considerations: 1. Handle certificate renewal/recreation for clean development environments. 2. Provide sample Nginx config for HTTPS reverse proxy. 3. Ensure both HTTP and HTTPS are available for legacy support. Expected output: A Symfony Docker setup with local SSL support and documentation for trusting certificates.
# Prompt 4: Running Symfony Console and Composer Commands in Docker Help me write Symfony code to use Docker for local development Code requirements: 1. Document how to execute Symfony console commands (e.g., `bin/console`) inside the PHP container. 2. Show how to run Composer install/update in the container for dependency management. 3. Add Makefile or bash script shortcuts for common container commands. 4. Handle file permissions for generated files. Additional considerations: 1. Provide troubleshooting for permission issues on Linux/Windows. 2. Recommend using Docker Compose exec for all CLI operations. 3. Document workflows for both Linux and Mac/Windows developers. Expected output: A Symfony/Docker setup with easy CLI command execution and clear developer guidance.
# Prompt 3: Using Docker Compose for Multi-Service Symfony Projects Help me write Symfony code to use Docker for local development Code requirements: 1. Create a `docker-compose.yml` that includes Symfony, database (MySQL/Postgres), Redis, and Mailhog services. 2. Configure Symfony `.env` to connect to each service. 3. Add health checks to each service in Docker Compose. 4. Show how to start, stop, and rebuild the stack. Additional considerations: 1. Mount local code and synchronize vendor/var directories. 2. Document service endpoints (e.g., Mailhog web UI, Redis CLI). 3. Add an example of using Docker volumes for persistent DB storage. Expected output: A robust Docker Compose setup for complex Symfony local development environments.
# Prompt 2: Symfony with Docker and Xdebug for Debugging Help me write Symfony code to use Docker for local development Code requirements: 1. Extend the Dockerfile to install and enable Xdebug for PHP. 2. Configure Xdebug remote debugging with IDE (e.g., VSCode or PhpStorm). 3. Document how to set up breakpoints and connect the debugger from outside the container. 4. Provide environment variables to toggle Xdebug on/off. Additional considerations: 1. Ensure Xdebug settings are secure for local only. 2. Optimize performance when Xdebug is disabled. 3. Include setup steps for developers using different IDEs. Expected output: A Dockerized Symfony setup with Xdebug and documentation for step debugging.
# Prompt 1: Basic Docker Setup for Symfony Local Development Help me write Symfony code to use Docker for local development Code requirements: 1. Create a simple `Dockerfile` for a Symfony application using PHP-FPM and Composer. 2. Write a `docker-compose.yml` file including PHP, Nginx, and MySQL/PostgreSQL services. 3. Mount local code into the container for live reloads. 4. Set up environment variables for database configuration. Additional considerations: 1. Add volume mappings for persistent storage. 2. Expose necessary ports for web and database access. 3. Provide build and run instructions for developers. Expected output: A minimal Docker and Docker Compose configuration for running Symfony locally.