Docker for Symfony application, powered by Nginx and php-fpm.
Based on Debian Jessie.
If you are experiencing some issues, take a look at TROUBLESHOOTING
latest 7 7.2 (7.2/Dockerfile)
7.1 (7.1/Dockerfile)
7.0 (7.0/Dockerfile)
5, 5.6 (5.6/Dockerfile)
5.4 (5.4/Dockerfile)
docker pull kibatic/symfonyThen run in your symfony folder
docker run -v $(pwd):/var/www -p 8080:80 kibatic/symfonySymfony app will be accessible on http://localhost:8080/app.php
If you want to replace the default nginx settings, overwrite configuration file at /etc/nginx/sites-enabled/default.
COPY nginx.conf /etc/nginx/sites-enabled/defaultYou may also want to add only some directives in existing site config.
COPY custom-config.conf /etc/nginx/conf.d/docker/custom-config.confA common practice is to log to stdout, but there are major bug in php-fpm wich makes stdout logging not reliable :
- Logs are truncated when message length exceed 1024 https://bugs.php.net/bug.php?id=69031
- FPM prepend a warning string to worker output https://bugs.php.net/bug.php?id=71880
This image setup a known workaround (see here) and expose a log stream as env var LOG_STREAM, but you cannot log to stdout For a proper logging you have to configure monolog to log to this stream
# app/config_dev.yml
monolog:
handlers:
main:
type: stream
path: '/tmp/stdout'
level: debugYou can also use symfony %env(LOG_STREAM)% if your symfony version is compatible with this syntax
We also provide a default dirty solution for standard monolog configuration, this is not recommended in production
tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log- nginx
- php*-fpm
- php*-cli
- php*-intl
- php*-mbstring
- 80 : nginx
