Skip to content

Instantly share code, notes, and snippets.

@puja108
Last active January 5, 2016 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puja108/288661c993d282319f44 to your computer and use it in GitHub Desktop.
Save puja108/288661c993d282319f44 to your computer and use it in GitHub Desktop.
Ghost and Wordpress using Docker on Giant Swarm
{
"name": "oghost",
"components": {
"oghost": {
"image": "ghost",
"ports": [
"2368/tcp"
],
"domains": {
"2368/tcp": [
"oghost.gigantic.io"
]
}
}
}
}
{
"name": "owordpress",
"components": {
"mysql": {
"image": "mysql:5.5", # I want 5.5, our team (cheating here) told me it's nice and small
"ports": [
"3306/tcp"
],
"env": [
"MYSQL_ROOT_PASSWORD=$mypass" # This is how you hand over environment variables to the swarm, same as -e in the docker command line. The $mypass is looked up in the swarmvars.json or can be passed on the command line
],
"volumes": [ # Here I am creating a bit of storage outside of the container, so the container can restart without the data being lost
{
"path": "/var/lib/mysql",
"size": "2 GB"
}
]
},
"wordpress": {
"image": "wordpress:latest", # I want the latest version here
"ports": [
"80/tcp" I tell the swarm that the container is communicating on port 80
],
"env": [
"WORDPRESS_DB_PASSWORD=$mypass" # Same as above, passing environment variables to the container
]
],
"volumes": [ # Again storage, this time for wordpress, so that custom files like plugins or uploaded images don't get lost
{
"path": "/var/www/html",
"size": "2 GB"
}
],
"domains": {
"80/tcp": [
"blog.thylmann.net", # This was for testing before I moved my blog completely using the next line
"owp.gigantic.io" # Yes, I did it
]
},
"links": [ # The wordpress container should link to a MySQL container, as it doesn't work without it
{
"component": "mysql",
"target_port": "3306/tcp"
}
]
}
}
}
@KevinField
Copy link

Possible typo report: IIUC, line 14 is missing a '$' in front of 'mypass'...although perhaps 'mypass' would also change there if you want WP accessing mysql with something other than the root password.

@puja108
Copy link
Author

puja108 commented Aug 11, 2015

@KevinField, true, sorry I didn't see your comment earlier, somehow GitHub notifications suck ;)

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