Sign inSign up

fchris82/symfony

By fchris82

•Updated over 6 years ago

Docker images to symfony projects

Image
0

1.1K

fchris82/symfony repository overview

⁠Symfony project images

Abilities:

  • clone user
  • set timezone and locale
  • switch on and off the xdebug
  • PHP configuration from ENV

⁠How to use

You need to edit files outside builds directory. In files in the builds directory are generated, you mustn't edit it directly!

The templates are in the config directory.

⁠Generate files
make -s all
⁠Build and push
make -s build-all

This script will build doctrine image and push to hub. It will run long.

⁠Build only one

Go to conrate build directory and run make -s build command.

⁠Environment variables

NameE.g. valueDescription
WWW_DATA_UID1001The current user id
WWW_DATA_GID1001The current user group id
TIMEZONEEurope/BudapestThe timezne what you want to use
LOCALEhu_HUThe locale value what you want to use
XDEBUG_ENABLED0 or 1You can switch on or off the xdebug (default: 0)
ERROR_LOG_ENABLED0 or 1You can switch on or off PHP error log (default: 1)
PHP_IDE_CONFIG"serverName=Docker"The xdebug server config name
CI0 or 1You can notify the container, it is running in CI test. Then it don't load the fpm.
PHP_MAX_EXECUTION_TIME30php.ini: max_execution_time in seconds
PHP_MEMORY_LIMIT128Mphp.ini: memory_limit
PHP_UPLOAD_MAX_FILESIZE50Mphp.ini: upload_max_filesize
PHP_MAX_FILE_UPLOADS20php.ini: max_file_uploads
PHP_POST_MAX_SIZE100Mphp.ini: post_max_size

⁠Suggested volumes

PathDescription
/var/wwwThis is the WORK_DIR! Load here the project.
/home/user/.sshSet here your SSH keys from ~/.ssh
/home/user/.gitconfigIt is the global .gitignore file
/home/user/.composerThe composer config directory
/usr/local/etc/php/conf.d/99-custom.ini.distYou can configure PHP through ENV. The php-fpm can't parse ENV variables, we load it with the entrypoint file!
/usr/local/etc/php/conf.d/xdebug.ini.distYou can configure PHP xdebug! It doesn't work when you disable it: XDEBUG_ENABLED=0

⁠Example docker-compose.yml

version: "3"

services:
    symfony:
        image:  fchris82/symfony:php7.2
        environment:
            - CI
            - WWW_DATA_UID
            - WWW_DATA_GID
            # Timezone
            - TIMEZONE
            # PHP config
            - PHP_MAX_EXECUTION_TIME
            - PHP_MEMORY_LIMIT
            - PHP_UPLOAD_MAX_FILESIZE
            - PHP_MAX_FILE_UPLOADS
            - PHP_POST_MAX_SIZE
            # Symfony parameters
            - SYMFONY_ENV
            - SYMFONY_DEBUG
            - SYMFONY_CLASSLOADER_FILE
            - SYMFONY_HTTP_CACHE
            - SYMFONY_HTTP_CACHE_CLASS
            - SYMFONY_TRUSTED_PROXIES
            - SYMFONY_DEPRECATIONS_HELPER
        volumes:
            # Full project files
            - ".:/var/www"
            # User SSH keys
            - "~/.ssh:/home/user/.ssh:ro"
            # Git config fájl bekötése
            - "~/.gitconfig:/home/user/.gitconfig:ro"
            # Composer cache
            - "~/.composer:/home/user/.composer"
            # Your own xdebug config
            - "~/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini.dist:ro"

Tag summary

Content type

Image

Digest

Size

280.6 MB

Last updated

over 6 years ago

docker pull fchris82/symfony:php7.4