Go to the Laravel readme found in its corresponding readme
You can download the repo as a zip, or clone on your workspace if you have the proper git setup:
git clone git@github.com:pitylee/emailMarketingTool.git
If you are not already in laradock directory, first change the current dir where you have the project:
cd /path/to/project/dir/
And then pull the laradock submodule, in some cases with older version of git this is needed:
git submodule update --init --recursive
With the latest Laradock version you will get some errors during the docker-compose build, that can be easily fixed by injecting some dependencies, in this case, since it is a submodule, it is required to do so after the submodule got initialised, in the Laradock workspace Dockerfile with the command:
awk '{sub(/apt-utils/,"libargon2-1 libidn2-0 libpcre2-8-0 libpcre3 libxml2 libzstd1 apt-utils")}1' ./laradock/workspace/Dockerfile > ./laradock/workspace/Dockerfile.txt && mv ./laradock/workspace/Dockerfile.txt ./laradock/workspace/Dockerfile
While a stable internet connection is needed, you may have to install Docker (Desktop) and Docker Compose if you don't have already installed. If you still have to install, please follow the official docs to do so here and here.
To give executive permission, run the following command:
chmod +x ./.start
You have to copy the nginx default.conf file from the root, to the laradock submodule's nginx sites directory:
cp default.conf ./laradock/nginx/sites/default.conf
You have to copy the corresponding .env file from the root, to the laradock submodule's directory:
cp .env.laradock ./laradock/.env
You have to copy the corresponding .env file from the root, to the tool directory for Laravel:
cp .env.laravel ./tool/.env
At this point, if you have already ran Laradock, you have to restart your Docker Desktop, and re-build the images, more specifically the nginx one, in order to force load the nginx configuration.
For short usage on Mac and Linux, you can run via the file which contains the commands:
bash .start
This will run the docker-compose commands, or you can rule them manually, via running in the terminal of your
preference:
cd ./laradock
docker-compose up -d --build nginx mysql redis php-worker
docker-compose exec --user=laradock workspace bash
When you see the that the Docker containers are up and running, and entered the workspace with one of the two solutions from above, you want to do a few small things:
cd tool/
composer install
php artisan key:generate
By default, the username and password for Laradock Mysql will be root:root. This is included in the .env, but you may want to double check with DBeaver, your Database editor of your <3's choice.
The migration:
php artisan migrate
The seeds:
php artisan db:seed ...
The tests:
php artisan test
- It can come in handy, that we have logs about the incoming requests + the generated MAC can be seen there as well. GUI for this: http://localhost/log-viewer/
- If you have a 500 error, in the laradock/ folder:
docker-compose logs nginx
- For when Docker fails to run LLB, run in your terminal, or edit+source your .(z)shrc the following:
export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0