This guide provides detailed instructions on setting up this project using the shinsenter/laravel docker image. This setup simplifies the development process by providing an isolated environment with all necessary dependencies.
Before starting, ensure you have the following installed on your local machine:
- Docker: Installation Guide
- Docker Compose: Installation Guide
If you have an existing Laravel project, clone it to your local machine. If you need to create a new project, follow the steps below.
git clone git@github.com:whilesmart/trakli-webservice.git
cd trakli-webserviceCreate a .env file in the root directory of your project, if it doesn't exist already. Adjust the database settings to match the environment variables specified in the docker-compose.yml file.
cp .env.example .envRun the following command to start your Docker containers:
docker compose up -dOnce the containers are up and running, you need to install the composer dependencies. You can do this by executing a command inside the app container.
NOTE: If you set up your ssh key with a passphrase, you will be prompted to enter it when running the command below.
docker compose exec app composer installOnce the containers are up and running, you need to generate an application key for Laravel. You can do this by executing a command inside the app container.
docker compose exec app php artisan key:generateTo set up your database, run the migrations and seeds using the following command:
docker compose exec app php artisan migrate --seedYour Laravel application should now be running and accessible at http://localhost:8000.
PHPMyAdmin is also available at http://localhost:8080.
Mailhog is available at http://localhost:8025.
To open a shell session inside the app container:
docker-compose exec app bashTo stop the running containers:
docker-compose downgit clone git@github.com:whilesmart/trakli-webservice.gitcd mymocomposer installcp .env.example .envphp artisan key:generatephp artisan migrate --seedphp artisan storage:link[Create a symlink forstorage/app/publicfiles to be accessible in thepublicdirectory]
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: