Sign inSign up

uqitsss/symfony-php5

By uqitsss

•Updated almost 9 years ago

Image
1

4.6K

uqitsss/symfony-php5 repository overview

⁠uq symfony docker container

⁠Running the container

Please note that there are really only two environments:

  • prod (app.php)
  • not prod (any arbitary name like 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.

⁠Testing the distribution using a shell

Assuming you are runnning a Docker-capable OS/environment:

$ docker run -it -v $PWD:/php/ -p 80:80 uqitsss/symfony-php5
    or in prod mode
$ docker run -it -v $PWD:/php/ -e "APP_RUN_MODE=prod" -p 80:80 uqitsss/symfony-php5

To connect to the docker container:

$ docker exec -it <container_id> bash
⁠Adding environment variables

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.

  1. Update parameters.yml file for your app.
    parameters:
    	new_env_var: "%new.env.var%"
    

Tag summary

Content type

Image

Digest

Size

455.5 MB

Last updated

almost 9 years ago

docker pull uqitsss/symfony-php5