- Clone the repository.
- Start the containers by running
docker-compose up -d
in the project root. - Install the composer packages by running
docker-compose exec laravel composer install
. - Access the Laravel instance on
http://localhost
(If there is a "Permission denied" error, rundocker-compose exec laravel chown -R www-data storage
).
Note that the changes you make to local files will be automatically reflected in the container.
If you want to make sure that the data in the database persists even if the database container is deleted, add a file named docker-compose.override.yml
in the project root with the following contents.
version: "3.7"
services:
mysql:
volumes:
- mysql:/var/lib/mysql
volumes:
mysql:
Then run the following.
docker-compose stop \
&& docker-compose rm -f mysql \
&& docker-compose up -d
- If it's your first time deploying the project, access your server's terminal and clone the git repository with the command:
git clone https://github.com/leandroeidi/yaraku-web-developer-assignment.git
- Create a new database through your server's database manager.
- Access the project folder by
cd yaraku-web-developer-assignment/src
- Create a .env file for the project. The easiest way is to duplicate the .env.example file with
cp .env.example .env
- For this project, you only need to change the fields in the .env file related to the database so the site can connect to it (DB_CONNECTION, DB_DATABASE, DB_USERNAME...)
- Run
composer install
. If an error occurs, runcomposer update
. - Run
php artisan key:generate
- Run
php artisan migrate
- Make your domain's root be the project's public folder. Eg.: /yaraku-web-developer-assignment/src/public
- The site should now be accessible.