@@ -62,17 +62,7 @@ On Linux and macOS, run `sudo nano /etc/hosts` to edit it.
6262
6363On Windows, edit the file ` C:\Windows\System32\drivers\etc\hosts ` with administrative privileges.
6464
65- ### Vagrant
66-
67- Check there is no application running on port 80 (like Apache or another virtual machine).
68-
69- If OK, run ` make vagrant ` , then ` vagrant up ` , and finally ` vagrant ssh ` to connect to the virtual machine.
70- From here, you'll be able to run all the next commands like Linux users!
71-
72- > Update the variable ` VAGRANT_PROJECT_NAME ` from the [ Makefile] ( Makefile ) with your project name.
73- > Only use alphanumeric characters (no spaces, distinguish words with ` _ ` or ` - ` ).
74-
75- ### Starting the Docker Compose stack
65+ ### First start
7666
7767Copy the file [ .env.dist] ( .env.dist ) to a file named ` .env ` . For instance:
7868
@@ -83,12 +73,44 @@ cp .env.dist .env
8373> Edit the [ .env.dist] ( .env.dist ) by updating the default values of ` DOMAIN ` , ` MYSQL_DATABASE ` and ` APP_SECRET `
8474> environment variables.
8575
86- Next, make sure there is no application running on port 80 (Vagrant users can skip this check).
76+ ---
77+
78+ #### Vagrant user
79+
80+ "Comment" the ` STARTUP_COMMAND_3 ` and ` STARTUP_COMMAND_4 ` environment variables from the ` api ` service
81+ in the [ docker-compose.yml] ( docker-compose.yml ) file.
82+
83+ Next, run:
84+
85+ ```
86+ docker-compose up webapp api
87+ ```
88+
89+ 📣  ;  ; This command start the ` webapp ` and ` api ` service. While booting, these services install the JavaScript
90+ and PHP dependencies. We cannot do that directly in the Vagrant VM as ` yarn ` and ` composer install ` fail miserably the
91+ first time.
8792
88- ** 📣  ;  ; Vagrant users: the first time you start the Docker Compose stack, you have to "comment" the following
89- environment variables from the ` api ` service in the [ docker-compose.yml] ( docker-compose.yml ) file:
90- ` STARTUP_COMMANDS_2 ` , ` STARTUP_COMMAND_3 ` , and ` STARTUP_COMMAND_4 ` . Indeed, ` composer install ` fails miserably,
91- but there is a workaround. See below.**
93+ Once the services have installed the dependencies, you may stop them with:
94+
95+ ```
96+ CTRL+C
97+ docker-compose down
98+ ```
99+
100+ Don't forget to uncomment the previous environments variables from the ` api ` service
101+ in the [ docker-compose.yml] ( docker-compose.yml ) file.
102+
103+ Next, check there is no application running on port 80 (like Apache or another virtual machine).
104+
105+ If OK, run ` make vagrant ` , then ` vagrant up ` , and finally ` vagrant ssh ` to connect to the virtual machine.
106+ From here, you'll be able to run all the next commands like Linux users!
107+
108+ > Update the variable ` VAGRANT_PROJECT_NAME ` from the [ Makefile] ( Makefile ) with your project name.
109+ > Only use alphanumeric characters (no spaces, distinguish words with ` _ ` or ` - ` ).
110+
111+ ---
112+
113+ Next, make sure there is no application running on port 80 (Vagrant users can skip this check).
92114
93115Good? You may now start all the Docker containers with the following commands:
94116
@@ -99,15 +121,11 @@ make up
99121It may take some time as each container will also set up itself, such as installing dependencies (PHP, JavaScript, etc.),
100122compiling sources (JavaScript), or running migrations to set up the database structure.
101123
102- ** 📣  ;  ; In some cases, the ` api ` service will try to run the migrations before the ` mysql ` service is ready. If so, restart
103- the ` api ` service with ` docker-compose up -d api ` .**
124+ ** 📣  ;  ; In some cases, the ` api ` service will try to run the migrations before the ` mysql ` service is ready.
125+ If so, restart the ` api ` service with ` docker-compose up -d api ` .**
104126
105127The containers will be ready faster next time you run this command as the first run is doing most of the setup.
106128
107- ** 📣  ;  ; Vagrant users: enter the ` api ` service with ` make api ` . Here, run ` composer install --prefer-source `
108- (and prepare some coffee). When done, exit the container, uncomment the previous environments variables,
109- and rerun ` make up ` .**
110-
111129Once everything is ready, the following endpoints should be available:
112130
113131* http://traefik.companies-and-products.localhost (Reverse proxy, the entry point of all the HTTP requests)
0 commit comments