Skip to content

Instantly share code, notes, and snippets.

@chmouel
Last active January 4, 2022 22:50
Show Gist options
  • Save chmouel/9796077 to your computer and use it in GitHub Desktop.
Save chmouel/9796077 to your computer and use it in GitHub Desktop.
A heat template that use docker to create containers for a wordpress install. You need to configure the plugin first in /etc/heat/heat.conf (see the README) and pull the images (i.e: docker pull samalba/wordpress samalba/mysql)
heat_template_version: 2013-05-23
description: >
Docker example template, you need to docker pull samalba/wordpress and samalba/mysql first.
resources:
wordpress:
type: DockerInc::Docker::Container
properties:
image: samalba/wordpress
env:
- {"Fn::Join": ["=", ["DB_HOSTNAME", { get_attr: [database, network_ip]}]]}
- {"Fn::Join": ["=", ["DB_PASSWORD", { get_attr: [database, logs_head]}]]}
- DB_PORT=3306
database:
type: DockerInc::Docker::Container
properties:
port_specs:
- 3306
image: samalba/mysql
outputs:
info:
description: IP address of server1 in private network
value:
str_replace:
template: http://host
params:
host: { get_attr: [wordpress, network_ip] }
@thierrymarianne
Copy link

Thank you ! Such concrete template -leveraging DockerInc::Docker::Container- is a blessing (I could not find more of the kind so far or maybe I didn't know where to find them)!

@larsks
Copy link

larsks commented Aug 31, 2014

I've just written an article that examines the Docker plugin for Heat in some detail; you can find it at http://blog.oddbit.com/2014/08/30/docker-plugin-for-openstack-he/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment