Skip to content

The primary goal of this project is to create a streamlined and efficient development environment using Docker Compose. This environment will consist of PHP-FPM, Xdebug, Nginx web server, and MariaDB, enabling developers to quickly and easily start working on their PHP projects.

Notifications You must be signed in to change notification settings

IshtarStar/docker-compose-nginx-phpfpm-xdebug-mariadb

Repository files navigation

Docker compose PHP 8.3.8, Xdebug 3.3.2, Nginx 1.27.0, Redis 7.2.5 and MariaDB 11.4.2

docker nginx php xdebug phpunit redis mariadb

Goal of this project

The primary goal of this project is to create a streamlined and efficient development environment using Docker Compose. This environment will consist of PHP-FPM, Xdebug, Nginx web server, and MariaDB, enabling developers to quickly and easily start working on their PHP projects.

Services

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/IshtarStar/docker-compose-nginx-phpfpm-xdebug-mariadb.git ./docker-skeleton
    cd docker-skeleton
  2. Build and start the Docker containers:

    docker compose up --build -d
  3. Install Composer dependencies:

    docker compose exec -T php-fpm composer install
  4. Run PHPUnit tests with code coverage:

    docker compose exec -T php-fpm ./vendor/bin/phpunit --coverage-text --testdox tests

Example PHPUnit Test

An example PHPUnit test is included in the tests directory:

// tests/ExampleTest.php

<?php

declare(strict_types=1);

use PHPUnit\Framework\TestCase;
use App\Example;

class ExampleTest extends TestCase
{
    public function testExample()
    {
        $example = new Example();
        $this->assertTrue($example->doSomething());
    }
}

See also: Blog-Post: Dockerize your PHP application with Nginx and PHP8 FPM

About

The primary goal of this project is to create a streamlined and efficient development environment using Docker Compose. This environment will consist of PHP-FPM, Xdebug, Nginx web server, and MariaDB, enabling developers to quickly and easily start working on their PHP projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages