David Flores
#Linux #Drupal #Symfony #WebDeveloper #Silex #OpenSource
David Flores
Co-Mantainer at @DrupalConsole, Linux, Drupal, Symfony, Silex, Docker, Security, Python, Open Source, Father ...sometimes #Nerd Speaker
david@indava.com
@dmouse
http://drupalconsole.com
http://www.meetup.com/es-ES/PHP-The-Right-Way/
Is a tool for defining and running multi-container Docker applications.
$ docker run --name app-redis -d redis
$ docker run --name app-php -d --link app-redis:redis php:7-fpm
$ docker run --name app-nginx -d -p 8080:80 \
-v app:/var/www/html --link app-php:php \
-e "NGINX_HOST=foobar.com" -e "NGINX_PORT=80" nginx
app-redis:
image: redis
app-php:
image: php:7-fpm
links:
- app-redis:redis
app-nginx:
image: nginx
links:
- app-php:php
volumes:
- app:/var/www/html
environment:
- NGINX_HOST=foobar.com
- NGINX_PORT=80
ports:
- "8080:80"
$ docker-compose up -d
~/p/w/indava.dev docker-compose up -d
Starting indavadev_indavaComDB_1
Starting indava-dev
https://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software
postgresql:
image: sameersbn/postgresql:9.4-3
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
volumes:
- /home/docker/gitlab/postgresql:/var/lib/postgresql
https://github.com/indava/gitlab/
redis:
image: sameersbn/redis:latest
volumes:
- /home/gitlab/redis:/var/lib/redis
https://github.com/indava/gitlab/
gitlab:
image: sameersbn/gitlab:8.9.5
links:
- redis:redisio
- postgresql:postgresql
- drone:drone.dev
ports:
- "10080:80"
- "10443:443"
- "2222:22"
environment:
- TZ=America/Mexico_City
- GITLAB_TIMEZONE=Kolkata
- GITLAB_SECRETS_DB_KEY_BASE=4BA
- GITLAB_HOST=domain.com
- GITLAB_PORT=443
- GITLAB_SSH_PORT=2222
- GITLAB_HTTPS=true
https://github.com/indava/gitlab/
drone:
image: drone/drone:0.4.2
ports:
- "10081:8000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/gitlab/drone:/var/lib/drone
environment:
REMOTE_DRIVER: gitlab
REMOTE_CONFIG: https://www.domain.com?client_id=XYZ&client_secret=ABC&open=true
https://github.com/indava/gitlab/
http://readme.drone.io/usage/overview/
build:
image: indava/drupal
commands:
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === '...') { } else { unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- php composer.phar install
- php vendor/bin/codecept run
deploy:
ssh:
host: chevecha.com
user: ci
port: 22
commands:
- cd /apps/indava && git pull origin master
- docker-compose build
- docker-compose up -d
- docker exec indava-test composer install --no-dev --prefer-dist
- docker exec -i indava-test ./vendor/bin/drupal --root=/var/www/html/web config:import
cache:
mount:
- .git
build:
image: php:5.6-apache
commands:
- echo "helloooou"
deploy:
ssh:
host: chevecha.com
user: ci
port: 22
commands:
- cd /apps/drupal-docker && git pull origin master
- docker build -t indava/drupal .
- docker push indava/drupal
By David Flores