-
Notifications
You must be signed in to change notification settings - Fork 17
Makefile
A Makefile is present in the repository to facilitate the usage of the Docker environment. In order to use it, you have to be in its directory. But as this file is quite useful and since we are often using the same commands all day, it's possible that you have also a Makefile in your project.
To avoid having to move to execute the right file, you can include the Makefile located in your environment directory in the Makefile located inside your project directory. Here is an example based on the structure described in the Before installation page.
───────┼───────────────────────────────────────────────────────────────────────
│ File: ~/www/myproject/Makefile
───────┼───────────────────────────────────────────────────────────────────────
1 │ # Project specific variables
2 │ DOCKER_PATH = $(HOME)/docker/magento2
3 │ PROJECT_PATH = /var/www/myproject
4 │
5 │ # Retrieve the Makefile used to manage the Docker environment
6 │ export COMPOSE_FILE = $(DOCKER_PATH)/docker-compose.yml
7 │ include $(DOCKER_PATH)/Makefile
8 │
9 │ [...]
With this structure, you can execute the environment targets like start or php directly from your project without adding the environment in your repository. And of course, you can also add your custom targets!