Symfony

Deployment & DevOps

Docker, CI/CD, Deployer, environment variables, secrets management, monitoring, logging

20 interview questionsยท
Senior
1

Which Docker file is recommended for defining services of a Symfony application (PHP-FPM, Nginx, PostgreSQL) in local development?

Answer

Docker Compose (docker-compose.yml or compose.yaml) allows defining and orchestrating multiple Docker containers. For Symfony, you typically define a PHP-FPM service to run the code, Nginx as web server, and PostgreSQL for the database. This approach ensures an identical development environment for the whole team and similar to production.

2

How to correctly define a DATABASE_URL environment variable in Symfony to be different in development and production?

Answer

Symfony uses the .env file for default values and .env.local for local overrides (not versioned). In production, it's preferable to define variables directly via system environment or server secrets. The .env.local file is never committed and allows each developer to have their own configurations.

3

Which Symfony command allows managing secrets securely in production (API keys, passwords)?

Answer

Symfony Secrets allows storing sensitive data in an encrypted manner. Secrets are stored in config/secrets/ and encrypted with a key. The secrets:set command adds a new secret, and only the environment with the decryption key can read the values. This is the recommended method for production credentials.

4

What is Deployer and what main advantage does it offer for deploying Symfony applications?

5

In a CI/CD pipeline for Symfony, what is the recommended sequence of main steps?

+17 interview questions

Master Symfony for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free