Last active
August 27, 2018 14:37
-
-
Save ivomarino/e19d206954fdf7d7611d53d1b4fcdf7a to your computer and use it in GitHub Desktop.
Docker provisioning with AppFlow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Docker | |
# | |
conf_docker_enable: true | |
conf_docker_persistent_storage_path: "/data/containers" | |
# If you want to share persistens volumes between nodes use GlusterFS | |
# conf_docker_persistent_storage_path: "/mnt/glusterfs/gvol0/brick1/containers" | |
conf_docker_group_members: [ syseng, otheruser ] | |
conf_docker_opts: "-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock --insecure-registry registry:5000" | |
conf_docker_networks: | |
internal: | |
name: internal | |
state: present | |
driver: bridge | |
conf_docker_containers: | |
traefik: | |
name: traefik | |
image: traefik | |
state: started | |
recreate: no | |
restart_policy: always | |
command: "--api --docker --docker.domain=test" | |
published_ports: | |
- "8082:80" | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock" | |
labels: | |
traefik.frontend.rule: "Host:lb.test" | |
traefik.port: "8080" | |
# The hashed password for admin is "admin" | |
traefik.frontend.auth.basic: "admin:$apr1$bwGgiIN6$n4DfC7/fL0aaAZgAoNnAI1" | |
traefik.docker.network: "bridge" | |
portainer: | |
name: portainer | |
image: portainer/portainer | |
state: started | |
recreate: no | |
restart_policy: always | |
hostname: portainer | |
published_ports: "127.0.0.1:9000:9000" | |
volumes: | |
- "/etc/timezone:/etc/timezone:ro" | |
- "/etc/localtime:/etc/localtime:ro" | |
- "/var/run/docker.sock:/var/run/docker.sock" | |
- "{{ conf_docker_persistent_storage_path }}/portainer/data:/data" | |
networks: | |
- name: "internal" | |
entrypoint: "/portainer" | |
command: "-H unix:///var/run/docker.sock --no-auth" | |
env: | |
VIRTUAL_HOST: "docker.test" | |
VIRTUAL_PORT: 9000 | |
wpdb: | |
image: mariadb | |
name: wpdb | |
state: started | |
recreate: no | |
restart_policy: always | |
labels: | |
traefik.enable: "false" | |
volumes: | |
- "/etc/timezone:/etc/timezone:ro" | |
- "/etc/localtime:/etc/localtime:ro" | |
- "{{ conf_docker_persistent_storage_path }}/wpdb/var/lib/mysql:/var/lib/mysql:rw" | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: wp | |
MYSQL_USER: wp | |
MYSQL_PASSWORD: wp | |
wp: | |
name: wp | |
image: wordpress:php7.2 | |
state: started | |
recreate: no | |
restart_policy: always | |
hostname: wp | |
volumes: | |
- "/etc/timezone:/etc/timezone:ro" | |
- "/etc/localtime:/etc/localtime:ro" | |
- "{{ conf_docker_persistent_storage_path }}/wp/var/www/html:/var/www/html:rw" | |
networks: | |
- name: "internal" | |
env: | |
WORDPRESS_DB_HOST: "wpdb:3306" | |
WORDPRESS_DB_USER: wp | |
WORDPRESS_DB_PASSWORD: wp | |
WORDPRESS_DB_NAME: wp | |
labels: | |
traefik.frontend.rule: "Host:wp.test" | |
traefik.docker.network: "bridge" | |
links: | |
- "wpdb" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment