Skip to content

Docker image with all the requirements for a Symfony project

License

Notifications You must be signed in to change notification settings

flobb/docker-symfony

Repository files navigation

Docker & Symfony

Docker Stars Docker Pulls Build Status

Docker image with all the minimum requirements for a Symfony project. You can also use the Symfony-CLI tool to initialize a project.

Image based on the PHP image

The latest tag is set on the 7.4.X-buster-cli image.

If you choose the image with Apache, the default VHOST will have the rewrite rules and the public folder set for a Symfony Flex project. So you don't need the symfony/apache-pack recipe by default.

Warning: You must mount a directory to /srv to make the entrypoint work (it use the host user to match the container www-data user).

Tags

Usage

$ docker run -it --rm \
    -v "$PWD":/srv \
    -v ~/.composer:/var/www/.composer \
    solune/symfony:latest \
    sh

Sharing your local Composer folder, allow you to share cache between containers and grant you some access token (to Github for example).

What's in ?

Image based on the PHP image

It add Git, Composer and the Symfony-Cli tool in the image.

The entrypoint is modified to match the user www-data to the id and group of the host user that share /srv. It avoid some difficulties with project files permissions between the host and the container. If you run something like composer or command, the entrypoint automatically make you use the www-data user.

The basic dependencies for Symfony are added and some Symfony friendly values are configured in a php.ini file.

You can also share your SSH socket to access private git repository or advanced Symfony-CLI exchange:

$ docker run -it --rm \
    -v "$PWD":/srv \
    -v ~/.composer:/var/www/.composer \
    -v $SSH_AUTH_SOCK:/tmp/ssh_auth_sock:ro \
    -e SSH_AUTH_SOCK=/tmp/ssh_auth_sock \
    solune/symfony:latest \
    sh

About

Docker image with all the requirements for a Symfony project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published