PHPackages                             systemsdk/docker-symfony-api - 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-symfony-api

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

systemsdk/docker-symfony-api
============================

JSON REST API

v4.0.0(1mo ago)604918MITPHPPHP ^8.5.0CI passing

Since Jan 15Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/systemsdk/docker-symfony-api)[ Packagist](https://packagist.org/packages/systemsdk/docker-symfony-api)[ Docs](https://github.com/systemsdk/docker-symfony-api)[ GitHub Sponsors](https://github.com/sponsors/systemsdk)[ Fund](https://opencollective.com/systemsdk-engineering)[ RSS](/packages/systemsdk-docker-symfony-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (124)Versions (50)Used By (0)

PHP symfony environment with JSON REST API example
==================================================

[](#php-symfony-environment-with-json-rest-api-example)

Docker environment (based on official php and mysql docker hub repositories) required to run Symfony with JSON REST API example.

[![Actions Status](https://github.com/systemsdk/docker-symfony-api/workflows/Symfony%20Rest%20API/badge.svg)](https://github.com/systemsdk/docker-symfony-api/actions)[![CircleCI](https://camo.githubusercontent.com/5e34312d7c834502fb44c66d9b7cef3afa9ca91689313a89c0985f353a567750/68747470733a2f2f636972636c6563692e636f6d2f67682f73797374656d73646b2f646f636b65722d73796d666f6e792d6170692e7376673f7374796c653d737667)](https://circleci.com/gh/systemsdk/docker-symfony-api)[![Coverage Status](https://camo.githubusercontent.com/68c665fb8b6d9b7f8e931b9c484bac2395272bd4a3439ea5435d093d7d0194e1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73797374656d73646b2f646f636b65722d73796d666f6e792d6170692f62616467652e737667)](https://coveralls.io/github/systemsdk/docker-symfony-api)[![Latest Stable Version](https://camo.githubusercontent.com/cb2fd4d3bcc96c6f9966b369795fd8444872ce96387e3d78e23020b8be1a2590/68747470733a2f2f706f7365722e707567782e6f72672f73797374656d73646b2f646f636b65722d73796d666f6e792d6170692f76)](https://packagist.org/packages/systemsdk/docker-symfony-api)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

[Source code](https://github.com/systemsdk/docker-symfony-api.git)

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

[](#requirements)

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

Note: OS recommendation - Linux Ubuntu based.

Components
----------

[](#components)

1. Nginx 1.29
2. PHP 8.4 fpm
3. MySQL 8
4. Symfony 7
5. RabbitMQ 4
6. Elasticsearch 7
7. Kibana 7
8. Redis 8
9. Mailpit (only for debug emails on dev environment)

Setting up Docker Engine with Docker Compose
--------------------------------------------

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

For installing Docker Engine with docker compose please follow steps mentioned on page [Docker Engine](https://docs.docker.com/engine/install/).

Note 1: Please run next cmd after above step if you are using Linux OS: `sudo usermod -aG docker $USER`

Note 2: If you are using Docker Desktop for MacOS 12.2 or later - please enable [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for performance (enabled by default since Docker Desktop v4.22).

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

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

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

If you have installed composer and want to install environment via composer, you can use the next cmd command:

```
composer create-project systemsdk/docker-symfony-api api-example-app
```

2.Set another APP\_SECRET for application in .env.prod and .env.staging files.

Note 1: You can get unique secret key for example [here](http://nux.net/secret).

Note 2: Do not use .env.local.php on dev and test environment (delete it if exist).

Note 3: If you want to change a default web port/xdebug configuration, you can create .env.local file and set some params (see .env file).

Note 4: Delete var/mysql-data folder if it exists.

3.Add domain to local `hosts` file:

```
127.0.0.1    localhost
```

4.Configure `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (MacOS) (optional):

- In case you need debug only requests with IDE KEY: PHPSTORM from frontend in your browser:

```
xdebug.start_with_request = no
```

Install locally in Firefox extension "Xdebug helper" and set in settings IDE KEY: PHPSTORM

- In case you need to debug any request to an api (by default):

```
xdebug.start_with_request = yes
```

5.Elasticsearch is pre-configured with the following privileged bootstrap user(you can use it in order to enter in Kibana):

```
user: elastic
password: changeme
```

Note: For prod/staging environment another password should be used.

6.Build, start and install the docker images from your terminal:

```
make build
make start
make composer-install
make generate-jwt-keys
```

7.Make sure that you have installed migrations / created roles and groups / cron jobs / messenger transports / elastic template:

```
make migrate
make create-roles-groups
make migrate-cron-jobs
make messenger-setup-transports
make elastic-create-or-update-template
```

8.In order to use this application, please open in your browser next urls:

-
- [http://localhost:15672 (RabbitMQ)](http://localhost:15672)
- [http://localhost:5601 (Kibana)](http://localhost:5601)
- [http://localhost:8025 (Mailpit)](http://localhost:8025)

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

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

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

Note: Delete var/mysql-data folder if it is exist.

If you have installed composer and want to install environment via composer you can use next cmd command:

```
composer create-project systemsdk/docker-symfony-api api-example-app
```

2.Elasticsearch is pre-configured with the following privileged bootstrap user:

```
user: elastic
password: changeme
```

3.Build, start and install the docker images from your terminal:

```
make build-staging
make start-staging
make generate-jwt-keys
```

4.Make sure that you have installed migrations / created roles and groups / cron jobs / messenger transports / elastic template:

```
make migrate-no-test
make create-roles-groups
make migrate-cron-jobs
make messenger-setup-transports
make elastic-create-or-update-template
```

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

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

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

If you have installed composer and want to install environment via composer you can use next cmd command:

```
composer create-project systemsdk/docker-symfony-api api-example-app
```

2.Edit compose-prod.yaml and set necessary user/password for MySQL and RabbitMQ.

Note: Delete var/mysql-data folder if it is exist.

3.Edit env.prod and set necessary user/password for MySQL and RabbitMQ.

4.Elasticsearch is pre-configured with the following privileged bootstrap user:

```
user: elastic
password: changeme
```

5.Build, start and install the docker images from your terminal:

```
make build-prod
make start-prod
make generate-jwt-keys
```

6.Make sure that you have installed migrations / created roles and groups / cron jobs / messenger transports / elastic template:

```
make migrate-no-test
make create-roles-groups
make migrate-cron-jobs
make messenger-setup-transports
make elastic-create-or-update-template
```

How to enable paid features for Elasticsearch
---------------------------------------------

[](#how-to-enable-paid-features-for-elasticsearch)

Switch the value of Elasticsearch's `xpack.license.self_generated.type` option from `basic` to `trial` (`/docker/elasticsearch/config/elasticsearch.yml`).

Getting shell to container
--------------------------

[](#getting-shell-to-container)

After application will start (`make start`) and in order to get shell access inside symfony container you can run following command:

```
make ssh
```

Note 1: Please use next make commands in order to enter in other containers: `make ssh-nginx`, `make ssh-supervisord`, `make ssh-mysql`, `make ssh-rabbitmq`.

Note 2: Please use `exit` command in order to return from container's shell to local shell.

Building containers
-------------------

[](#building-containers)

In case you edited Dockerfile or other environment configuration you'll need to build containers again using next commands:

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

Note: Please use environment-specific commands if you need to build test/staging/prod environment, more details can be found using help `make help`.

Start and stop environment containers
-------------------------------------

[](#start-and-stop-environment-containers)

Please use next make commands in order to start and stop environment:

```
make start
make stop
```

Note 1: For staging environment need to be used next make commands: `make start-staging`, `make stop-staging`.

Note 2: For prod environment need to be used next make commands: `make start-prod`, `make stop-prod`.

Stop and remove environment containers, networks
------------------------------------------------

[](#stop-and-remove-environment-containers-networks)

Please use next make commands in order to stop and remove environment containers, networks:

```
make down
```

Note: Please use environment-specific commands if you need to stop and remove test/staging/prod environment, more details can be found using help `make help`.

Additional main command available
---------------------------------

[](#additional-main-command-available)

```
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-staging
make env-prod

make generate-jwt-keys

make ssh
make ssh-root
make fish
make ssh-nginx
make ssh-supervisord
make ssh-mysql
make ssh-rabbitmq
make ssh-elasticsearch
make ssh-kibana

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

make info
make help

make logs
make logs-nginx
make logs-supervisord
make logs-mysql
make logs-rabbitmq
make logs-elasticsearch
make logs-kibana

make drop-migrate
make migrate
make migrate-no-test
make migrate-cron-jobs

make fixtures

make create-roles-groups

make messenger-setup-transports

make elastic-create-or-update-template

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

etc....
```

Notes: Please see more commands in Makefile

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

[](#architecture--packages)

- [Symfony](https://symfony.com)
- [doctrine-migrations-bundle](https://github.com/doctrine/DoctrineMigrationsBundle)
- [doctrine-fixtures-bundle](https://github.com/doctrine/DoctrineFixturesBundle)
- [command-scheduler-bundle](https://packagist.org/packages/dukecity/command-scheduler-bundle)
- [phpunit](https://github.com/sebastianbergmann/phpunit)
- [dama/doctrine-test-bundle](https://packagist.org/packages/dama/doctrine-test-bundle)
- [phpunit-bridge](https://github.com/symfony/phpunit-bridge)
- [browser-kit](https://github.com/symfony/browser-kit)
- [css-selector](https://github.com/symfony/css-selector)
- [security-checker](https://github.com/fabpot/local-php-security-checker)
- [messenger](https://symfony.com/doc/current/messenger.html)
- [composer-bin-plugin](https://github.com/bamarni/composer-bin-plugin)
- [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)
- [requirements-checker](https://github.com/symfony/requirements-checker)
- [security-advisories](https://github.com/Roave/SecurityAdvisories)
- [jwt-authentication-bundle](https://packagist.org/packages/lexik/jwt-authentication-bundle)
- [automapper-plus-bundle](https://packagist.org/packages/mark-gerarts/automapper-plus-bundle)
- [symfony-console-form](https://packagist.org/packages/matthiasnoback/symfony-console-form)
- [api-doc-bundle](https://packagist.org/packages/nelmio/api-doc-bundle)
- [cors-bundle](https://packagist.org/packages/nelmio/cors-bundle)
- [device-detector](https://packagist.org/packages/matomo/device-detector)
- [uuid-doctrine](https://packagist.org/packages/ramsey/uuid-doctrine)
- [doctrine-extensions](https://packagist.org/packages/gedmo/doctrine-extensions)
- [easy-log-bundle](https://packagist.org/packages/systemsdk/easy-log-bundle)
- [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/phpstan/phpstan)
- [phpinsights](https://packagist.org/packages/nunomaduro/phpinsights)
- [beberlei/doctrineextensions](https://github.com/beberlei/DoctrineExtensions)
- [elasticsearch](https://github.com/elastic/elasticsearch-php)
- [rector](https://packagist.org/packages/rector/rector)

External links / resources
--------------------------

[](#external-links--resources)

- [Symfony Flex REST API](https://github.com/tarlepp/symfony-flex-backend.git): code in "src/" folder forked from Symfony Flex REST API.

Guidelines
----------

[](#guidelines)

- [Commands](docs/commands.md)
- [Api Key](docs/api-key.md)
- [Development](docs/development.md)
- [Testing](docs/testing.md)
- [IDE PhpStorm configuration](docs/phpstorm.md)
- [Xdebug configuration](docs/xdebug.md)
- [Swagger](docs/swagger.md)
- [Postman](docs/postman.md)
- [Redis GUI](docs/rdm.md)
- [Messenger component](docs/messenger.md)

Working on your project
-----------------------

[](#working-on-your-project)

1. For new feature development, fork `develop` branch into a new branch with one of the two patterns:
    - `feature/{ticketNo}`
2. Commit often, and write descriptive commit messages, so it's easier to follow steps taken when reviewing.
3. Push this branch to the repo and create pull request into `develop` to get feedback, with the format `feature/{ticketNo}` - "Short descriptive title of Jira task".
4. Iterate as needed.
5. Make sure that "All checks have passed" on CircleCI(or another one in case you are not using CircleCI) and status is green.
6. When PR is approved, it will be squashed &amp; merged, into `develop` and later merged into `release/{No}` for deployment.

Note: You can find git flow detail example [here](https://danielkummer.github.io/git-flow-cheatsheet).

License
-------

[](#license)

[The MIT License (MIT)](LICENSE)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 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 ~32 days

Recently: every ~56 days

Total

49

Last Release

47d ago

Major Versions

v0.1.0 → v1.0.02022-05-01

v1.7.1 → v2.0.02024-02-14

v2.2.0 → v3.0.02024-06-25

v3.9.0 → v4.0.02026-03-30

PHP version history (5 changes)v0.1.0PHP ^8.1.0

v1.4.0PHP ^8.2.0

v2.0.0PHP ^8.3.0

v3.4.0PHP ^8.4.0

v4.0.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 (3 commits)")

---

Tags

cicrondddddd-exampledockerelasticsearchkibanamulti-environmentmysqlmysql8nginxphpphp8rabbitmqrest-apisupervisordswaggersymfonysymfony7xdebugphpapisymfonyelasticsearchmysqlrabbitmqdockernginxsupervisord

### Embed Badge

![Health badge](/badges/systemsdk-docker-symfony-api/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[easycorp/easyadmin-demo

EasyAdmin Demo Application

145.7k](/packages/easycorp-easyadmin-demo)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[forumify/forumify-platform

121.8k11](/packages/forumify-forumify-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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