Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main container #2

Open
hmil opened this issue Nov 27, 2015 · 2 comments
Open

Add main container #2

hmil opened this issue Nov 27, 2015 · 2 comments

Comments

@hmil
Copy link
Member

hmil commented Nov 27, 2015

One way to tie everything together would be to have a main container containing the build tools (ie. npm, grunt, composer...) and having access to the infrastructure repository itself.

schematic

@christophetd
Copy link

By "main container", do you mean "docker container"? Docker's philosophy isn't really about having one big container running multiple applications, but rather many little ones handling little parts.
E.g. a solution would be :

  • a container for the DB server (which includes a database for the staging and one for the production), or maybe one for each environment
  • a container for the replica of the DB server
  • a container running nginx + php to serve the staging and the production
  • a container running a small node script which handles github webhooks and takes care of the deployment of the application

A docker-compose.yml file may look like:

web: 
    image: courseadvisor/nginx-php
    volumes:
        - /var/www/courseadvisor/:/var/www/courseadvisor
    links:
        - mysql:mysql
    env_file: mysql.env # mysql credentials

mysql:
   build: mysql/ 
   # custom dockerfile and config in the mysql/ subfolder
   # for instance it may start from the mysql official image and create the courseadvisor
   #  DB structure + import the last backup

   env_file: mysql.env

mysql-slave:
   build: mysql-slave/
   # same but with mysql_slave
   link: 
     - mysql:mysql

webhook:
   image: webhook/
   # custom dockerfile installing node, devtools, and running github webhook
   env_file: github.env # github repo url, secret key...

   volumes: 
       - /var/www/courseadvisor/:var/www/courseadvisor

And then docker compose up to run the whole thing

@hmil
Copy link
Member Author

hmil commented Nov 28, 2015

Yup, my bad I should have made this more clear: Each rectangular box in the diagram represents one container ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants