carlessanagustin
5/27/2016 - 4:55 AM

Comparison between a docker-compose script and a ansible playbook for launchin a Wordpress stack

Comparison between a docker-compose script and a ansible playbook for launchin a Wordpress stack

docker-compose

wordpress:
 image: wordpress
 links:
   - db:mysql
 ports:
   - 8080:80

db:
 image: mariadb
 environment:
   MYSQL_ROOT_PASSWORD: example

ansible playbook

---
- name: "Launch wordpress container"
  docker:
    name: wordpress
    image: wordpress
    links:
      - db:mysql
    ports:
      - 8080:80

- name: "Launch database container"
  docker:
    name: db
    image: mariadb
    env:
      MYSQL_ROOT_PASSWORD: example

from: https://www.ansible.com/blog/six-ways-ansible-makes-docker-compose-better