Please note that there are really only two environments:
prod (app.php)uat, beta, prod, etc.) (app_dev.php)The image assumes that everything that is specific to an environment, such as
database settings, passwords, etc. are baked into the parameters.yml file
which was compiled into the pre-built application archive. The only front
controller that gets executed in a "not dev" environment is app.php. This
reduces the number of configuration points, the need to pre-bake an
environment into the application code (making extra front controllers, etc),
and the need to modify these build scripts to handle extra environments.
Assuming you are runnning a Docker-capable OS/environment:
$ docker run -it -v $PWD:/php/ -p 80:80 uqitsss/symfony-php7
or in prod mode
$ docker run -it -v $PWD:/php/ -e "APP_RUN_MODE=prod" -p 80:80 uqitsss/symfony-php7
To connect to the docker container:
$ docker exec -it <container_id> bash
Environment variables are required to make our builds independent of deployment environments. Settings in parameter.yml that differ between deployment environments (for e.g. staging, beta) must be setup as environmental variables.
Following steps will demonstrate adding the environment variable
new_env_var, which you will need to pass in as a docker environmental variable called SYMFONY__NEW__ENV__VAR for symfony to pick up.
parameters:
new_env_var: "%new.env.var%"
Content type
Image
Digest
Size
475 MB
Last updated
over 7 years ago
docker pull uqitsss/symfony-php7