Docker will create a MySQL container with a new database for you automatically.
Be sure to set the database name, username, password you want to use in docker-compose.yml
Run the containers
A helper tool called dcp exists in the root of the project. You may need to give it executable permissions before using it (chmod +x ./dcp).
Start the containers with this command.
If this is your first time running this command, it may take a little while to download/build the images.
Run the install command
Now run the ./dcp artisan asgard:install command to perform the AsgardCMS installation process.
When prompted for database credentials, use the details you specified in the docker-compose.yml file.
When asked for the mysql host, use the name of the mysql container from docker-compose.yml (by default mysql).
You can now login on http://localhost/auth/login with the email and password you entered during the install command. After you've logged in you'll be able to access the administration panel by visiting http://localhost/backend.
You will need to use the ./dcp command when interacting with the container.
The most common commands you will need are:
./dcp: Check the status of the containers
./dcp up: Bring up the containers
./dcp down: Stop the containers
./dcp rs: Restart the containers
./dcp composer: Run composer in the container
./dcp artisan or ./dcp art or ./dcp a: Run the artisan command
./dcp test: Run phpunit in a new container
./dcp t: Run phpunit in the app container
./dcp yarn: Run yarn
./dcp npm: Run npm
For most of the above commands any arguments you enter after the command will be passed to the original command, for example running ./dcp artisan migrate would run php artisan migrate and ./dcp test Modules/Core/Tests would run PHPUnit for the Core module.
Tip! You can alias ./dpc to dpc
Rebuilding the image
Whenever you make a change to the Dockerfile files, you will have to rebuild the images for the changes to take effect. This can be done with: