Effortlessly set up a Symfony development environment using DevContainers.
- Docker or similar container runtime (e.g. Podman, OrbStack)
- Compose or similar container orchestration tool (e.g. Podman Compose)
- Visual Studio Code
- DevContainers Extension
- Copy the
.devcontainer
folder into root of your Symfony project. - Open the project in Visual Studio Code.
- Click on the green icon in the bottom left corner and select
Reopen in Container
. - ... Profit!
By default, the containers forward the following ports:
-
The
dev
service in thecompose.yml
file forwards the8000
port from the PHP container to the host machine. You can change the port by modifying theports
field in thedev
service. -
The
mailer
service forwards the8025
port from the Mailer container to the host machine. You can change the port by modifying theports
field in themailer
service.
Symfony DevContainer comes with tree containers:
- PHP 8.3 (from official Docker image php:8.3-cli) with
- Composer
- Symfony CLI
- Some PHP extensions (e.g. xdebug, intl, pdo_pgsql)
- PostgreSQL 16 (from official Docker image postgres:16-alpine)
- Mailer (from axllent/mailpit)
You can customize the containers by editing the .devcontainer/compose.yml
file.
If you need to install additional PHP extensions or specific versions of software :
- Modify the
Dockerfile
, build and push the image to your Docker registry. - Update the
image
field in thedev
service in thecompose.yml
file.
This project is not open to contributions at the moment.
I'ts a personal project for my own use and i don't have the time to maintain it.
Feel free to fork the project and make your own changes.
This project is licensed under the MIT License - see the LICENSE file for details.