{"id":15025464,"url":"https://github.com/kibatic/symfony-docker","last_synced_at":"2025-04-09T20:03:44.436Z","repository":{"id":47204162,"uuid":"51140503","full_name":"kibatic/symfony-docker","owner":"kibatic","description":"Docker for Symfony application :whale: ","archived":false,"fork":false,"pushed_at":"2025-02-21T10:46:44.000Z","size":219,"stargazers_count":39,"open_issues_count":2,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T20:03:35.689Z","etag":null,"topics":["docker","nginx","php","php-7","php-fpm","symfony","symfony-docker"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kibatic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-05T10:34:24.000Z","updated_at":"2025-03-24T08:28:53.000Z","dependencies_parsed_at":"2024-06-08T20:44:18.092Z","dependency_job_id":"0481bacc-6656-4c81-abf7-63ab9dca677c","html_url":"https://github.com/kibatic/symfony-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibatic%2Fsymfony-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibatic%2Fsymfony-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibatic%2Fsymfony-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibatic%2Fsymfony-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kibatic","download_url":"https://codeload.github.com/kibatic/symfony-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103864,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","nginx","php","php-7","php-fpm","symfony","symfony-docker"],"created_at":"2024-09-24T20:02:23.765Z","updated_at":"2025-04-09T20:03:44.427Z","avatar_url":"https://github.com/kibatic.png","language":"Dockerfile","readme":"![symfony-docker](http://i.imgur.com/vc5ZVqL.png?2)\n\nSymfony + Nginx + php-fpm\n=========================\n\n[![Build Status](https://travis-ci.org/kibatic/symfony-docker.svg?branch=master)](https://travis-ci.org/kibatic/symfony-docker)\n[![](https://images.microbadger.com/badges/image/kibatic/symfony:latest.svg)](https://microbadger.com/images/kibatic/symfony:latest \"Get your own image badge on microbadger.com\")\n[![](https://images.microbadger.com/badges/version/kibatic/symfony:latest.svg)](https://microbadger.com/images/kibatic/symfony:latest \"Get your own version badge on microbadger.com\")\n\n\nDocker for Symfony application, powered by **Nginx** and **php-fpm**.\n\nBased on Debian Jessie.\n\nIf you are experiencing some issues, take a look at [TROUBLESHOOTING](TROUBLESHOOTING.md)\n\n\nSupported tags and respective `Dockerfile` links\n------------------------------------------------\n\nImage tags follows PHP versions\n\n`latest` `8.1` [(8.1/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/8.1/Dockerfile)\n\n`8.0` [(8.0/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/8.0/Dockerfile)\n\n`7` `7.4` [(7.4/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.4/Dockerfile)\n\n`7.3` [(7.3/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.3/Dockerfile)\n\n`7.2` [(7.2/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.2/Dockerfile)\n\n`7.1` **Not maintained, END OF LIFE**\n\n`7.0` **Not maintained, END OF LIFE**\n\n`5`, `5.6` **Not maintained, END OF LIFE**\n\n`5.4` **Not maintained, END OF LIFE**\n\nCompatibility matrix\n--------------------\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003c/th\u003e\n            \u003cth colspan=\"6\"\u003eSymfony\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003cth rowspan=\"9\"\u003eImage\u003c/th\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e2.x\u003c/td\u003e\n            \u003ctd\u003e3.x\u003c/td\u003e\n            \u003ctd\u003e4.x\u003c/td\u003e\n            \u003ctd\u003e5.x\u003c/td\u003e\n            \u003ctd\u003e6.x\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e8.1\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e8.0\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (default)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e7.4\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (default)\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e7.3\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (default)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e7.2\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e7.1\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark:\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e7.0\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e5.6\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:heavy_check_mark: (not tested)\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n            \u003ctd\u003e:x:\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\nComposer versions :\n\n- 8.0+ : 2.x\n- 7.4 : 2.x\n- 7.3 : 1.10.17\n- 7.2 : 1.10.17\n\nUsage\n-----\n\n### Basic Usage\n\n```bash\ndocker pull kibatic/symfony\n```\n\nThen run in your symfony folder\n\n```bash\n# Image \u003e= 7.3 \u0026 Symfony 2.x, 3.x\ndocker run -e SYMFONY_VERSION=3 -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.3\n\n# Image \u003e= 7.3 \u0026 Symfony 4.x\ndocker run -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.3\n\n# Image \u003c 7.3 \u0026 Symfony 2.x, 3.x\ndocker run -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.2\n\n# Image \u003c 7.3 \u0026 Symfony 4.x\ndocker run -e SYMFONY_VERSION=4 -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.2\n```\n\nSymfony app will be accessible on http://localhost:8080/\n\n\n### use of blackfire (PHP \u003e= 8.4)\n\nAdd the following vars in the docker-compose file :\n\n\n```yaml\n  web:\n    build: .\n    volumes:\n      - .:/var/www\n    environment:\n      PERFORMANCE_OPTIM: \"false\"\n      BLACKFIRE_SERVER_ID: 3xxxx-xxxxx-xxxxxx-xxxxxxx-xxc\n      BLACKFIRE_SERVER_TOKEN: 5d6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc47fb\n      BLACKFIRE_CLIENT_ID: 8exxxxx-xxx-xxxxx-xxxxxx-xx5\n      BLACKFIRE_CLIENT_TOKEN: 6caaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx012\n```\n\nThen to enable or disalble blackfire :\n\n```bash\n# enable blackfire\ndocker compose exec -T web /enable-blackfire.sh --on\n\n# disable blackfire\ndocker compose exec -T web /enable-blackfire.sh --off\n```\n\nIn our project, we use a Makefile to simplify the commands (from the container or from the host) :\n\n```makefile\n_enable-blackfire: ## enable blackfire\n\t/enable-blackfire.sh --on\n\nenable-blackfire: ## enable blackfire\n\tdocker compose exec -T web make _enable-blackfire\n\n_disable-blackfire: ## disable blackfire\n\t/enable-blackfire.sh --off\n\ndisable-blackfire: ## disable blackfire\n\tdocker compose exec -T web make _disable-blackfire\n```\n\nCustom nginx configuration\n--------------------------\n\nIf you want to replace the default nginx settings, overwrite configuration file at `/etc/nginx/sites-enabled/default`.\n\n```dockerfile\nCOPY nginx.conf /etc/nginx/sites-enabled/default\n```\n\nYou may also want to add only some directives in [existing site config](7.4/rootfs/etc/nginx/sites-enabled/default#L5).\n\n```dockerfile\nCOPY custom-config.conf /etc/nginx/conf.d/docker/custom-config.conf\n```\n\nLogging\n------\n\n### Logging (PHP \u003e= 7.3)\n\nFor both production and dev environment you should log to stdout / stderr, example below.\n\n```yaml\n# config/packages/monolog.yaml\nmonolog:\n    handlers:\n        stdout:\n            type: stream\n            path: 'php://stdout'\n            level: debug\n            channels: ['!event']\n            # (Optional) format logs to json\n            #formatter: monolog.formatter.json\n        stderr:\n            type: stream\n            path: 'php://stderr'\n            level: error\n            # (Optional) format logs to json\n            #formatter: monolog.formatter.json\n```\n\n\n### Logging (PHP \u003c 7.3)\n\nA common practice is to log to stdout, but there are major bug in php-fpm wich makes stdout logging not reliable  :\n\n* Logs are truncated when message length exceed 1024 https://bugs.php.net/bug.php?id=69031\n* FPM prepend a warning string to worker output https://bugs.php.net/bug.php?id=71880\n\nThis image setup a known workaround ([see here](https://github.com/docker-library/php/issues/207)) and expose a log stream as env var **LOG_STREAM**, but **you cannot log to stdout**\nFor a proper logging you have to configure monolog to log to this stream\n\n```yaml\n# app/config_dev.yml\nmonolog:\n    handlers:\n        main:\n            type:   stream\n            path:   '/tmp/stdout'\n            level:  debug\n```\n\nYou can also use symfony `%env(LOG_STREAM)%` if your symfony version is compatible with [this syntax](https://symfony.com/doc/3.4/configuration/external_parameters.html)\n\nWe also provide a default dirty solution for standard monolog configuration, **this is not recommended in production**\n\n```bash\ntail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log\n```\n\nMinimal package included\n------------------------\n\n* nginx\n* php\\*-fpm\n* php\\*-cli\n* php\\*-intl\n* php\\*-mbstring\n\nExposed port\n------------\n\n* 80 : nginx\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibatic%2Fsymfony-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkibatic%2Fsymfony-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibatic%2Fsymfony-docker/lists"}