Skip to content

Instantly share code, notes, and snippets.

@cecyc
Created September 16, 2016 19:54
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 cecyc/a8eb38c33e88ce338966d3e96fe036dc to your computer and use it in GitHub Desktop.
Save cecyc/a8eb38c33e88ce338966d3e96fe036dc to your computer and use it in GitHub Desktop.
Sample Docker Compose file for a simple WordPress setup
version: '2' #The Docker Compose file format version to be used
services:
database: #The name of the container, you can name this whatever you want.
image: mysql:latest #The image you are pulling into the container
environment:
MYSQL_ROOT_PASSWORD: tacos
MYSQL_DATABASE: tacos
MYSQL_USER: tacos
MYSQL_PASSWORD: tacos
wordpress: #The name of the container, you can name this whatever you want.
image: wordpress:latest #Pulling latest wordpress image
depends_on: #Define dependencies (i.e. Wordpress needs a database)
- database
ports: #Exposing ports to access the container
- "8080:80"
environment:
WORDPRESS_DB_HOST: database:3306 #port 3305 for MySQL
WORDPRESS_DB_PASSWORD: tacos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment