this docker-compose is designed for a Linux operating system, provide adaptations for a Mac or Windows environment.
- Linux (Ubuntu 20.04 or other)
- docker
- docker-compose
- git
- yarn
- node
Add group for your user to avoid sudo: https://docs.docker.com/engine/install/linux-postinstall
Run the docker-compose to build your local environment
docker-compose build
docker-compose up -d
Copy .env.dist to .env and modify the .env file like this example to adapt your uses:
DATABASE_URL="mysql://root:root@mysql:3306/navigo?serverVersion=mariadb-10.3.29&charset=utf8mb4"
- Log into the PHP container
docker-compose exec php bash
- Install dependencies :
cd api && composer install
- Create database:
php bin/console d:d:c
- Play migrations :
php bin/console d:m:m
- Play fixtures :
php bin/console d:f:l --no-interaction
- Start the server :
symfony serve -d
Your application will be at http://127.0.0.1:8000
- Exit PHP container and go to frontend dir
- Start front with :
yarn startco
(like yarn start, but using craco)
This docker-compose provides you :
- PHP-8.1.0-cli (Debian)
- Composer
- Symfony CLI
- and some other php extentions
- nodejs, npm, yarn
- mariadb/server:10.3
- maildev (mailcatcher)