Symfony 4 starter-kit for multi container stack.
-
Before installing project make sure the following prerequisites have been met.
-
We’ll download the code from its repository on GitHub.
-
Configure Xdebug [
Optional
]We'll configure Xdebug for IDE PHPStorm.
-
All will works well now.
For now, this project has been mainly created for Unix (Linux/MacOS)
. Perhaps it could work on Windows.
All requisites should be available for your distribution. The most important are :
Check if docker-compose
is already installed by entering the following command :
which docker-compose
Check Docker Compose compatibility :
The following is optional but makes life better :
which make
- Nginx
- Varnish
- Postgres
- Adminer
You should be careful when installing third party web servers such as MySQL or Nginx.
This project use the following ports :
Server | Port |
---|---|
Postgres | 5432 |
Adminer | 2000 |
Nginx | 8080 |
Varnish | 8081 |
H2-Proxy (SSL) | 80 |
To install Git, download it and install following the instructions :
git clone [email protected]:woprrr/sf-api-4-skeleton-docker.git
Go to the project directory :
cd symfony-4-skeleton-docker
.
├── LICENSE
├── Makefile
├── README.md
├── client_secrets.json.enc
├── docker-compose.yml.dist
├── h2-proxy
│ ├── Dockerfile
│ └── conf.d
├── helm
│ └── symfony
└── symfony
├── Dockerfile
├── Dockerfile.nginx
├── Dockerfile.varnish
├── bin
├── composer.json.dist
├── config
├── docker
├── public
└── src
If you use another IDE than PHPStorm, go to the remote debugging section of Xdebug documentation.
For a better integration of Docker to PHPStorm, use the documentation.
-
Edit docker-compose file
docker-compose.yml
edit/adjust the configuration as needed forXDEBUG_CONFIG
ANDPHP_IDE_CONFIG
environment variables. -
If needed add a server for PHP as explained @see Add a debug server section.
-
Setup project environment variables :
Setup your project by editing the
.env
file and customize all environement variables. By default the ENV file are in symfony folder./symfony/.env
-
Initialize/Install project dependencies :
make docker-start
-
Open your favorite browser :
- [http://localhost:8080](http://localhost:8080/ OR http://nginx.local-symfony.com) (Web Front).
- http://localhost:8081 (Web Front Varnished).
- [https://localhost](https://localhost OR https://nginx.local-symfony.com) (Web Front HTTPS).
- http://localhost:2000 Adminer (username: symfony, password: symfony)
-
Stop and clear services :
sudo docker-compose down -v
-
Stop and delete all traces of changes from skeleton :
sudo make clean
That delete all files to reset skeleton at his initial state.
Any thought, feedback or (hopefully not!)