|
1 |
| -# 🐳 Docker + PHP 7.4 + MySQL + Nginx + Symfony 5 Boilerplate |
| 1 | +# 🐳 Docker + PHP 8.0 + MySQL + Nginx + Symfony 5.3 Boilerplate |
2 | 2 |
|
3 | 3 | ## Description
|
4 | 4 |
|
5 |
| -This is a complete stack for running Symfony 5 into Docker containers using docker-compose tool. |
| 5 | +This is a complete stack for running Symfony 5.3 into Docker containers using docker-compose tool with [docker-sync library](https://docker-sync.readthedocs.io/en/latest/). |
6 | 6 |
|
7 |
| -It is composed by 3 containers: |
| 7 | +It is composed by 4 containers: |
8 | 8 |
|
9 | 9 | - `nginx`, acting as the webserver.
|
10 |
| -- `php`, the PHP-FPM container with the 7.4 PHPversion. |
| 10 | +- `php`, the PHP-FPM container with the 8.0 version of PHP. |
11 | 11 | - `db` which is the MySQL database container with a **MySQL 8.0** image.
|
| 12 | +- `symfony_docker_app_sync` to sync files using library `docker-sync `. |
12 | 13 |
|
13 | 14 | ## Installation
|
14 | 15 |
|
15 | 16 | 1. 😀 Clone this rep.
|
16 | 17 |
|
17 |
| -2. Run `docker-compose up -d`
| 18 | +2. Create the file `./.docker/.env.nginx.local` using `./.docker/.env.nginx` as template. The value of the variable `NGINX_BACKEND_DOMAIN` is the `server_name` used in NGINX. |
18 | 19 |
|
19 |
| -3. The 3 containers are deployed: |
| 20 | +3. Go inside folder `./docker` and run `docker-sync-stack start` to start containers. |
20 | 21 |
|
21 |
| -``` |
22 |
| -Creating symfony-docker_db_1 ... done |
23 |
| -Creating symfony-docker_php_1 ... done |
24 |
| -Creating symfony-docker_nginx_1 ... done |
25 |
| -``` |
| 22 | +4. You should work inside the `php` container. This project is configured to work with [Remote Container](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for Visual Studio Code, so you could run `Reopen in container` command after open the project. |
26 | 23 |
|
27 |
| -4. Use this value for the DATABASE_URL environment variable of Symfony: |
| 24 | +5. Inside the `php` container, run `composer install` to install dependencies from `/var/www/symfony` folder. |
| 25 | + |
| 26 | +6. Use the following value for the DATABASE_URL environment variable: |
28 | 27 |
|
29 | 28 | ```
|
30 | 29 | DATABASE_URL=mysql://app_user:helloworld@db:3306/app_db?serverVersion=5.7
|
31 | 30 | ```
|
32 | 31 |
|
33 | 32 | You could change the name, user and password of the database in the `env` file at the root of the project.
|
34 |
| - |
0 commit comments