PHPackages                             systemsdk/docker-nginx-php-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. systemsdk/docker-nginx-php-laravel

ActiveProject[Database &amp; ORM](/categories/database)

systemsdk/docker-nginx-php-laravel
==================================

Docker laravel environment

v5.1.0(2w ago)346495118MITPHPPHP ^8.5.0CI passing

Since Dec 26Pushed 2w ago17 watchersCompare

[ Source](https://github.com/systemsdk/docker-nginx-php-laravel)[ Packagist](https://packagist.org/packages/systemsdk/docker-nginx-php-laravel)[ Docs](https://github.com/systemsdk/docker-nginx-php-laravel)[ GitHub Sponsors](https://github.com/sponsors/systemsdk)[ Fund](https://opencollective.com/systemsdk-engineering)[ RSS](/packages/systemsdk-docker-nginx-php-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (36)Versions (31)Used By (0)

PHP Laravel Environment
=======================

[](#php-laravel-environment)

A scalable Docker-based environment required to run Laravel (based on official php and mysql docker hub repositories).

[![Actions Status](https://github.com/systemsdk/docker-nginx-php-laravel/workflows/Laravel%20App/badge.svg)](https://github.com/systemsdk/docker-nginx-php-laravel/actions)[![CircleCI](https://camo.githubusercontent.com/9168b42efcf9932541761d1c344304691d695d08a85274089d0dea8c02d61cdf/68747470733a2f2f636972636c6563692e636f6d2f67682f73797374656d73646b2f646f636b65722d6e67696e782d7068702d6c61726176656c2e7376673f7374796c653d737667)](https://circleci.com/gh/systemsdk/docker-nginx-php-laravel)[![Coverage Status](https://camo.githubusercontent.com/48d9d2841cf4046b145cd37f2c999ce2a3db63b218ee392d2cfc76cab3efa364/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73797374656d73646b2f646f636b65722d6e67696e782d7068702d6c61726176656c2f62616467652e737667)](https://coveralls.io/github/systemsdk/docker-nginx-php-laravel)[![Latest Stable Version](https://camo.githubusercontent.com/c9bff2e8a66acfa2bbb9ea21fe3bc0c022791cc8054fbca5f88939916f35b13d/68747470733a2f2f706f7365722e707567782e6f72672f73797374656d73646b2f646f636b65722d6e67696e782d7068702d6c61726176656c2f76)](https://packagist.org/packages/systemsdk/docker-nginx-php-laravel)[![Total Downloads](https://camo.githubusercontent.com/962c00f1b0e76874262df6698b3ca3aea0d69108c6aae20149f5cd1cda12c58e/68747470733a2f2f706f7365722e707567782e6f72672f73797374656d73646b2f646f636b65722d6e67696e782d7068702d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/systemsdk/docker-nginx-php-laravel)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

[Source code](https://github.com/systemsdk/docker-nginx-php-laravel.git)

Requirements
------------

[](#requirements)

- Docker Engine version 23.0 or later
- Docker Compose version 2.0 or later
- An editor or IDE
- MySQL Workbench

Note: We recommend using a Linux Ubuntu-based OS for the best experience.

Components
----------

[](#components)

1. Nginx 1.29 - Web server and reverse proxy.
2. PHP 8.5 fpm - Main application runtime.
3. MySQL 8 - Primary relational database.
4. Laravel 13 - High-performance PHP framework.
5. Mailpit - Email testing tool (available in the development environment only).

Setting up Docker Engine &amp; Docker Compose
---------------------------------------------

[](#setting-up-docker-engine--docker-compose)

To install Docker Engine and Docker Compose, please follow the official [Docker Engine Installation Guide](https://docs.docker.com/engine/install/).

**For Linux Users:**After installation, run the following command to manage Docker as a non-root user (this allows you to run Docker without `sudo`):

```
sudo usermod -aG docker $USER
```

Note: You must log out and log back in for this change to take effect.

**For macOS Users:**If you are using Docker Desktop for macOS 12.2 or later, we highly recommend enabling [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for a significant performance boost.

Note: Enabled by default since Docker Desktop v4.22.

Setting up the DEV environment
------------------------------

[](#setting-up-the-dev-environment)

1. You can clone this repository from GitHub or install via composer.

    Note: Delete the `storage/mysql-data` folder if it exists before starting.

    If you have installed composer, you can use the next cmd command:

    ```
    composer create-project systemsdk/docker-nginx-php-laravel example-app
    ```
2. Verify that your local `hosts` file contains the default mapping for `localhost` (this is usually set by default in all operating systems):

    ```
    127.0.0.1    localhost

    ```

    Note: The file is located at `/etc/hosts` on Linux/macOS and `C:\Windows\System32\drivers\etc\hosts` on Windows.
3. Configure Xdebug (Optional)

    Depending on your operating system, you can customize Xdebug behavior by editing either `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (macOS).

    - To debug every request (Default):

        This is the default setting. It will intercept and debug all incoming API requests.

        ```
        xdebug.start_with_request = yes
        ```
    - To debug only specific requests (On-Demand):

        If you prefer to trigger the debugger manually only when making requests from a browser frontend, change the configuration to:

        ```
        xdebug.start_with_request = no
        ```

        Tip: Install the "Xdebug helper" extension for Chrome or Firefox and set the IDE Key to `PHPSTORM` in the extension settings.
4. Build and Initialize the Environment

    Run the following commands in your terminal to build the Docker images, start the containers, install PHP dependencies:

    ```
    make build
    make start
    make composer-install
    make env-dev
    ```

    Note 1: To change the default Docker configurations (such as WEB\_PORT), open the `.env` file, update the required variables, then stop, rebuild, and restart the containers.

    Note 2: When modifying database variables in the `.env` file (like MYSQL\_VERSION or MYSQL\_ROOT\_PASSWORD), ensure you stop the containers and delete the `storage/mysql-data` directory before rebuilding the images.
5. Apply Migrations and Seeds:

    ```
    make migrate
    make seed
    ```
6. Set key for application:

    ```
    make key-generate
    ```
7. Access Application Services

    Once the environment is successfully running, you can access the various services in your browser using the following URLs:

    - **DEV page:**
    - **Mailpit (Debug Email):**

Setting up the STAGING environment locally
------------------------------------------

[](#setting-up-the-staging-environment-locally)

Important: This section describes how to set up the staging environment locally for debugging and verification purposes only. A real STAGING environment must be deployed on a dedicated server and should be as close to the PRODUCTION environment as possible.

Note 1: These steps assume you have already completed steps 1 through 2 of the "Setting up the DEV environment" section above.

Note 2: If you want to change default docker configurations (web\_port, etc...) - create uncommitted `.env` file, copy data from `.env.staging`, edit necessary environment variables values.

1. Database Clean-up

    Delete the `storage/mysql-data` and `vendor` folder if it exists before starting.
2. Build and Initialize the Environment

    Run the following commands in your terminal to build the staging Docker images, start the containers, install PHP dependencies:

    ```
    make build-staging
    make start-staging
    ```

    Note: With `opcache.validate_timestamps=0` ([php.ini](docker/staging/php.ini)) enabled for performance, any manual file changes or code updates require a PHP-FPM restart/reload to take effect.
3. Apply Migrations:

    ```
    make migrate-no-test
    ```
4. Set key for application:

    ```
    make key-generate
    ```

Setting up the PROD environment locally
---------------------------------------

[](#setting-up-the-prod-environment-locally)

Important: This section describes how to set up the production environment locally for debugging and verification purposes only. A real PROD environment must be deployed on a dedicated server.

Note 1: These steps assume you have already completed steps 1 through 2 of the "Setting up the DEV environment" section above.

Note 2: If you want to change default docker configurations (web\_port, etc...) - create uncommitted `.env` file, copy data from `.env.prod`, edit necessary environment variables values.

1. Database Clean-up

    Delete the `storage/mysql-data` and `vendor` folder if it exists before starting.
2. Build and Initialize the Environment

    Run the following commands in your terminal to build the production Docker images, start the containers, install PHP dependencies:

    ```
    make build-prod
    make start-prod
    ```

    Note: With `opcache.validate_timestamps=0` ([php.ini](docker/prod/php.ini)) enabled for performance, any manual file changes or code updates require a PHP-FPM restart/reload to take effect.
3. Apply Migrations:

    ```
    make migrate-no-test
    ```
4. Set key for application:

    ```
    make key-generate
    ```

Accessing Container Shells
--------------------------

[](#accessing-container-shells)

Once the application is running (via `make start`), you can easily access the command line inside your containers.

To open a shell inside the main **laravel** container, run:

```
make ssh
```

You can also access the other services using the following commands:

```
make ssh-nginx
make ssh-supervisord
make ssh-mysql
```

Tip: Type `exit` and press Enter to leave the container's shell and return to your local terminal.

Rebuilding Containers
---------------------

[](#rebuilding-containers)

If you modify any `Dockerfile` or environment configurations, you will need to rebuild the containers using the following commands:

```
make down
make build
make start
```

Note: Use environment-specific commands if you need to rebuild the test, staging, or production environments. For a complete list of available commands, run `make help`.

Starting and Stopping Containers
--------------------------------

[](#starting-and-stopping-containers)

Use the following commands to start or stop the development environment:

```
make start
make stop
```

If you are working with the staging or production environments, use their respective commands:

- Staging: `make start-staging` or `make stop-staging`.
- Production: `make start-prod` or `make stop-prod`.

Stopping and Removing Containers
--------------------------------

[](#stopping-and-removing-containers)

To completely stop and remove all environment containers and networks, use the following command:

```
make down
```

Note: Use environment-specific commands if you need to tear down the test, staging, or production environments. For a complete list of available commands, run `make help`.

Available Makefile Commands
---------------------------

[](#available-makefile-commands)

Here is a reference list of the primary commands available for managing the environment, databases, logs and testing:

```
make build
make build-test
make build-staging
make build-prod

make start
make start-test
make start-staging
make start-prod

make stop
make stop-test
make stop-staging
make stop-prod

make down
make down-test
make down-staging
make down-prod

make restart
make restart-test
make restart-staging
make restart-prod

make env-dev
make env-test-ci

make ssh
make ssh-root
make fish
make ssh-nginx
make ssh-supervisord
make ssh-mysql

make composer-install-no-dev
make composer-install
make composer-update
make composer-audit

make key-generate

make info
make help

make logs
make logs-nginx
make logs-supervisord
make logs-mysql

make drop-migrate
make migrate-no-test
make migrate

make seed

make phpunit
make report-code-coverage

make phpcs
make ecs
make ecs-fix
make phpmetrics
make phpcpd
make phpcpd-html-report
make phpmd
make phpstan
make phpinsights

# ... and many more
```

Note: For a complete list of all available commands, please inspect the `Makefile` directly or run `make help`.

Architecture &amp; packages
---------------------------

[](#architecture--packages)

- [Laravel](https://laravel.com)
- [phpunit](https://github.com/sebastianbergmann/phpunit)
- [laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper)
- [scriptsdev](https://github.com/neronmoon/scriptsdev)
- [composer-bin-plugin](https://github.com/bamarni/composer-bin-plugin)
- [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
- [composer-unused](https://packagist.org/packages/icanhazstring/composer-unused)
- [composer-require-checker](https://packagist.org/packages/maglnet/composer-require-checker)
- [security-advisories](https://github.com/Roave/SecurityAdvisories)
- [php-coveralls](https://github.com/php-coveralls/php-coveralls)
- [easy-coding-standard](https://github.com/Symplify/EasyCodingStandard)
- [PhpMetrics](https://github.com/phpmetrics/PhpMetrics)
- [phpcpd](https://packagist.org/packages/systemsdk/phpcpd)
- [phpmd](https://packagist.org/packages/phpmd/phpmd)
- [phpstan](https://packagist.org/packages/nunomaduro/larastan)
- [phpinsights](https://packagist.org/packages/nunomaduro/phpinsights)
- [rector](https://packagist.org/packages/rector/rector)

Guidelines
----------

[](#guidelines)

- [Commands](docs/commands.md)
- [Development](docs/development.md)
- [IDE PhpStorm Configuration](docs/phpstorm.md)
- [Xdebug Configuration](docs/xdebug.md)
- [Code Quality Tools](docs/code-quality.md)
- [Testing](docs/testing.md)

Development Workflow
--------------------

[](#development-workflow)

1. **Branching:** Create a new branch from `develop` using one of the following patterns:
    - `feature/{ticketNo}`
    - `bugfix/{ticketNo}`
2. **Commits:** Commit frequently and write clear, descriptive commit messages to facilitate the review process.
3. **Pull Request:** Push your branch to the repository and open a Pull Request (PR) against the `develop` branch. Use the following naming convention for your PR: `feature/{ticketNo} - Short descriptive title of the Jira task`.
4. **Review:** Address any feedback from reviewers and iterate as needed.
5. **CI/CD Checks:** Ensure that all continuous integration checks (e.g., CircleCI) pass successfully and the build status is green.
6. **Merge:** Once approved, your PR will be squashed and merged into `develop`. It will later be merged into a `release/{version}` branch for deployment.

Note: For a detailed visual guide on this branching model, please refer to the [Git Flow Cheatsheet](https://danielkummer.github.io/git-flow-cheatsheet).

License
-------

[](#license)

[The MIT License (MIT)](LICENSE)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance96

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~112 days

Total

29

Last Release

20d ago

Major Versions

v1.0.0 → v2.0.02022-05-07

v2.4.0 → v3.0.02023-01-21

v3.4.0 → v4.0.02024-06-10

v4.4.3 → v5.0.02026-04-05

PHP version history (7 changes)v1.0.0PHP ^8.0

v2.0.0PHP ^8.1

v3.0.0PHP ^8.2

v3.4.0PHP ^8.3

v4.3.0PHP ^8.4

v5.0.0PHP ^8.5

v5.1.0PHP ^8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/33e0fb1bc5cd58d4a1d671f46cd90d2d922ec5392f91b87ea346dcb82716b637?d=identicon)[dimadeush](/maintainers/dimadeush)

---

Top Contributors

[![dimadeush](https://avatars.githubusercontent.com/u/4595354?v=4)](https://github.com/dimadeush "dimadeush (1 commits)")

---

Tags

bitbucket-pipelinescirclecicrondockergithub-actionslaravellaravel13multi-environmentmysqlmysql8nginxphpphp8sslsupervisordubuntuxdebugphplaravelmysqldockernginxsupervisord

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/systemsdk-docker-nginx-php-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/systemsdk-docker-nginx-php-laravel/health.svg)](https://phpackages.com/packages/systemsdk-docker-nginx-php-laravel)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

4041.8k](/packages/codewithdennis-larament)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

471.8k](/packages/ercogx-laravel-filament-starter-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
