Warning : I learn this tech actually, this is my first conf docker for dev environment.
-
git hub :
https://github.com/sofiane-wattiez/env-docker-symfony6-php8.git
-
docker hub :
https://hub.docker.com/repository/docker/swattiez/symfony6-php8
docker-compose build
docker-compose up -d
Connect into the PHP container
docker exec -it 669f3ffc9f54 bash
symfony new new-project --full
cd new-project
symfony serve -d
adduser username
chown username:username -R .
Your application is available at : http://127.0.0.1:9000
If you need a database, modify the .env file like this example:
DATABASE_URL="postgresql://symfony:ChangeMe@database:5432/app?serverVersion=13&charset=utf8
This docker-compose provides you :
- PHP-8.0.13-cli (Debian)
- Composer
- Symfony CLI
- common php extentions
- nodejs, npm, yarn
- postgres:13-alpine
- mailcatcher
Out of the container, this docker-compose is created for a Linux OS , use wsl2 if you used windows
- WSL2 with linux distrib (Only for Windows user)
- Linux (Ubuntu)
- Docker
- Docker-compose
- Sofiane Wattiez