Caution: this is still work in progress.
Replace this title and the following description with your project name and description.
An example of a web application built with Nuxt.js, Symfony 5 and GraphQL.
Install the latest version of Docker and Docker Compose.
We strongly recommend installing Vagrant and VirtualBox.
Indeed, Docker has currently huge performance issues on MacOS and using Vagrant allows us to abstract the MacOS filesystem bringing an almost Linux-like experience regarding performances.
A Linux-like terminal is strongly advised in order to run the Makefile
commands.
Vagrant might also be an interesting solution regarding performances.
If not possible, you may also directly run the commands specified in the Makefile
.
For instance, instead of running make up
, run docker-compose up -d
.
Update your hosts
file with the following entry:
127.0.0.1 *.localhost
On MacOs, run sudo nano /etc/hosts
to edit it.
On Windows, edit the file C:\Windows\System32\drivers\etc\hosts
with administrative privileges.
If you're using Vagrant, check there no application running on port 80 (like Apache or another virtual machine).
If OK, run make vagrant
, then vagrant up
and finally vagrant ssh
in order to connect to the virtual machine. From here you'll be able to run all the next commands like
the Linux users!
Update the variable
PROJECT_NAME
from theMakefile
with your own project name. Only use alphanumeric characters (no spaces, distinguish words with_
or-
).
Copy the file .env.dist
to a file named .env
. For instance:
cp .env.dist .env
Edit the
.env.dist
by updating the default values ofDOMAIN
,MYSQL_DATABASE
andAPP_SECRET
environment variables.
Next make sure there is no application running on port 80 (Vagrant users can skip this check).
Good? You may now start all the Docker containers with the following commands:
make up
It may take some time as each container will also setup itself, for instance by installing dependencies (PHP, JavaScript etc.), compiling sources (JavaScript) or run migrations for setting up the database structure.
Next time you run this command, the containers should be ready faster as most of the setting up will already be done.
Once everything is ready, the following endpoints should be available:
- http://traefik.companies-and-products.localhost
- http://companies-and-products.localhost
- http://api.companies-and-products.localhost
- http://phpmyadmin.companies-and-products.localhost
- http://minio.companies-and-products.localhost
- http://rabbitmq.companies-and-products.loclahost
- http://mailhog.companies-and-products.loclahost
Update the domain with the one used in your project.
You may finally start the message consumer with:
make consume
You should ignore globally some folders like those generated by your IDE and Vagrant.
If not already done, you need to tell Git where to find your global .gitignore
file.
For instance, on Linux/MacOS/Windows git bash:
git config --global core.excludesfile '~/.gitignore'
Windows cmd:
git config --global core.excludesfile "%USERPROFILE%\.gitignore"
Windows PowerShell:
git config --global core.excludesfile "$Env:USERPROFILE\.gitignore"
Then create the global .gitignore
file according to the location specified previously.
You may now edit it, according to your environment, with:
# IDE
.idea
.vscode
# MacOS
.DS_Store
# Vagrant
.vagrant
Make sure you have read the following documentations:
As simple as the make up
command, run make down
to stop the entire Docker Compose stack.
If you're a Vagrant user, you may also stop the virtual machine with vagrant halt
.
If you're not going to work on the project for while, you may also destroy
the virtual machine using vagrant destroy
.
All aggregated logs:
docker-compose logs -f
Logs of one service:
docker-compose logs -f SERVICE_NAME
For instance, if you want the logs of the api
service:
docker-compose logs -f api