Sign inSign up

carbonsphere/docker-centos6-symfony

By carbonsphere

•Updated almost 11 years ago

Image
1

418

carbonsphere/docker-centos6-symfony repository overview

Author : CarbonSphere
Email : [email protected]⁠

⁠Docker Symfony 2 Base Platform

⁠This is a symfony base container which depends on another DB container (carbonsphere/docker-mysql-phpmyadmin).
⁠Setup Procedure
  • Pull required container

    1. docker pull carbonsphere/docker-mysql-phpmyadmin

    2. docker pull carbonsphere/docker-centos6-symfony

    3. Start DB container "docker run -d --name db carbonsphere/docker-mysql-phpmyadmin"

    4. Start Symfony container "docker run -d -p 8080:80 -p 222:22 --name web --link db:db carbonsphere/docker-centos6-symfony"

    5. Initialize DB from symfony to linked DB #use "docker ps" to find your {container id} docker exec -it {container id} bash #once entered into container shell run the following command to initialize DB #Note: This only needs to be done once. sh /root/createUserDb.sh

    Note: If you would like to build your own container image.

⁠Exposed Ports
- Symfony server port 80 - SSH 22 "For git check in/out" # Note: Private keys are generated during build time. Check your build log for Symfony SECRET key & Private key #Utility script in /root/changesshkey.sh to help you change your private key
⁠Symfony Environment variables

⁠Symfony project folder name

ENV SYMFONYPROJECTNAME myProject

⁠DB Host Name

ENV CARBON_MYSQL_DB_HOST db

⁠DB Host Port

ENV CARBON_MYSQL_DB_PORT 3306

⁠Symfony's DB name

ENV CARBON_APP_NAME symfonydb

⁠Symfony's DB Account name

ENV CARBON_MYSQL_DB_USERNAME symfonyusr

⁠Symfony's DB Account password

ENV CARBON_MYSQL_DB_PASSWORD symfonypas

⁠Mailer Server Type

ENV CARBON_MAILER_TRANS smtp

⁠Mailer Host IP/Name

ENV CARBON_MAILER_HOST 127.0.0.1

⁠Mailer Account name

ENV CARBON_MAILER_USER null

⁠Mailer Account password

ENV CARBON_MAILER_PASS null

⁠Symfony's Secret token

ENV CARBON_SECRET DEFAULT_SECRET

These environment variables are used instead of what is in parameters.yml

DEFAULT_SECRET and RSA SSH Private Keys are randomly generated during image built time. Highly recommend changing your private keys using /root/changesshkey.sh Change your secret token by "CARBON_SECRET=cat /dev/urandom | tr -cd 'a-f0-9' | head -c 40"

You can change these environment variables by using docker run -e CARBON_MYSQL_DB_HOST=db01 -d -P --link db:db01 carbonsphere/docker-centos6-symfony

⁠Checkout Symfony Project from docker container
  1. Check build log for private key. ssh-add private key to your identity
  2. git clone ssh://root@{docker ip}:{container port ex:222}/root/{SYMFONYPROJECTNAME ex:myProject}
⁠Post Receive Instructions

Git push will execute the following instructions

  1. Force checkout from remote checked-in contents
  2. Reset properties for newly added/checked-in contents
  3. Remove cache
  4. Composer Update - Update/Add newly added components
  5. Install assets and dumping assetics
  6. Force Update/Create new created/modified DB schema
  7. Restart Symfony Server Process

Tag summary

Content type

Image

Digest

sha256:3960a4be4…

Size

184.6 MB

Last updated

almost 11 years ago

docker pull carbonsphere/docker-centos6-symfony