docker run -d -p 80:8300 -v "$(pwd)/symfony:/symfomy" vladkras/nginx-unit-symfony4
- Wait
ls symfony
This image uses vladkras/nginx-unit-php7 to create Symfony 4 project.
Symfony is a set of PHP Components, a Web Application framework, a Philosophy, and a Community — all working together in harmony. © https://symfony.com
NGINX Unit is a new, lightweight, open source application server built to meet the demands of today’s dynamic and distributed applications. © https://www.nginx.com
You can use it to start your Symfony project in just one command.
Same as parent image you can launch it with
docker run -p 80:8300 vladkras/nginx-unit-symfony4
this command will install additional php extensions and Composer in Dockerfile and create blank (aka skeleton) symfony4 project in entrypoint.sh
Wait a while and open http://localhost (or any other ip bound to your docker machine). You should see "Welcome to Symfony" page.
I don't use -d
key here for development purposes. If you add it be patient! Symfony installation may some time depending on your system resources and network speed.
Surely you need access to your code, so add volume to your command:
docker run -p 80:8300 -v "$(pwd)/code:/symfony" vladkras/nginx-unit-symfony4
By default Symfony is installed in /symfony/
dir (why not?). Of course you can use any dir instead $(pwd)/code
on your host machine but it must be empty for installation to succeed.
SYMFONY_VERSION=4.0.*
you can change default value with:
docker run -p 80:8300 -e SYMFONY_VERSION=4.0.0 vladkras/nginx-unit-symfony4
though, this will affect only symfony/skeleton package
Default INSTALL_PATH=/symfony
if you want to install Symfony somewhere else. If you use it you have to reconfigure your app by changing config json and sending it again to control socket
If you have any questions feel free to open New issues
This package is licensed under MIT License and contains:
- Composer also available under MIT License
- NGINX Unit licensed under Apache License
- Symfony licensed under MIT License too