-
Create a
.env
file from.env.dist
$ cp .env.dist .env && nano .env $ cd app && cp .env.dist .env
-
Build and run the stack in detached mode (stop any system's ngixn/apache2 service first)
$ docker-compose build $ docker-compose up -d
-
Prepare the Symfony application
-
Update Symfony env variables (.env)
#... DATABASE_URL=mysql://db_user:db_password@mysql:3306/db_name #...
-
Composer install & update the schema from the container, execute migrations
$ docker-compose exec php-fpm bash $ composer install $ bin/console doctrine:schema:update --force $ bin/console doctrine:migrations:migrate
-
Generate the SSL keys
$ bin/console lexik:jwt:generate-keypair
-
Now we can stop our stack with docker-compose down
and start it again with docker-compose up -d
Once all the containers are up, our services are available at:
- Symfony app:
localhost:8081
- Front:
localhost:8081\index.html
- PhpMyAdmin:
localhost:8080
Getting user authorization token from the console
```sh
$ docker-compose exec php-fpm bash
$ bin/console app:token username password
```