This is a Laravel boilerplate project. Usage of the provided CI/CD products / services, are purely optional.
The Laravel boilerplate project focus:
To develop your Laravel application, with Docker, in a local environment.
Please review the files mentioned below, before performing any continued development:
- The
composer.json
file, please review sections such asrequire
andrequire-dev
. - The
package.json
file. Deletepackage-lock.json
file, if you're usingyarn
. - Example helper functions, under
app/Helpers
. Delete them if not used or required, then updateconfig/app.php
underaliases
. - The
tests/*
files (more will be defined for CI/CD purposes).
Lastly, this boilerplate will be maintained, by updating to the latest Laravel version (upon official Laravel latest release, after reviewing the upgrade notes and change logs).
For more information, go to Laravel Release Notes.
There are pre-defined example workflows
. They are meant to be later customized, or define new workflows to tailor
your development workflow needs:
- Testing each Laravel deployment on each supported OS.
- Running your Laravel PHPUnit tests.
- Install and test your PHP modules beforehand.
- Create your own Docker container action.
And so much more.
Below are the services defined in the docker-compose.yml
file:
- Microsoft SQL Server (optional)
- MySQL (optional)
- NGINX
- PHP-FPM
- PhpMyAdmin (optional)
- Redis (optional)
The services mentioned above are mostly optional, as you are welcome to make any changes to the Dockerfile
and
docker-compose.yml
files to suit your local development needs.
All Docker configurations for each service, are defined in the .docker
folder structure.
- Modify your configurations for each service, that suits your needs. They are each located in the
.docker
folder. - Modify your
Dockerfile
anddocker-compose.yml
files, to suit your containerization needs. - Run
composer install
. - Define your environment variables in the
.env
file, including your database connection driver. - Run the
docker-compose
commands below in order.# Pulls an image associated with a service defined in a docker-compose.yml or docker-stack.yml file, but does not start containers based on those images. docker-compose pull # Services are built once and then tagged, by default as 'project_service'. docker-compose build # Builds, (re)creates, starts, and attaches to containers for a service, also as 'Detached mode'. docker-compose up -d
- That's it! Enjoy coding with Laravel!
-
There were some changes made with the Docker containers, why aren't they showing changes made?
Try below in order, following commands should help make each build helpful for development workflow.
# Stops containers and removes containers, networks, volumes, and images created by up. docker-compose down # Services are built once and then tagged, by default as 'project_service'. docker-compose build # If no changes to Dockerfiles. docker-compose build --no-cache # Builds, (re)creates, starts, and attaches to containers for a service, also as 'Detached mode'. docker-compose up -d
-
Some Linux packages are not installing, or have an error returned for some of them. How do we resolve these issues?
Based on the error(s) received, it varies from incorrect packages installed with mismatched OS type, to deprecated package names used. However, it is still all about modifying the
apt-get
commands in theDockerfile
at project root.
The online resources for the sqlsrv pdo drivers
constantly changes, however would like to leave a note here that
you'll need them to be added as a php extension
, in order to make a successful mssql database connection.
It is like any other database driver, just that these are obtained and configured differently, as opposed to postgres
,
sqlite
and others.
docker-compose down
(https://docs.docker.com/compose/reference/down/)docker-compose build
(https://docs.docker.com/compose/reference/build/)docker-compose up
(https://docs.docker.com/compose/reference/up/)
- Laravel (https://laravel.com/)
- PHP (https://www.php.net/downloads)
- Composer (https://getcomposer.org/)
- Docker Compose (https://docs.docker.com/compose/)
- GitHub Actions (https://docs.github.com/en/actions)