Skip to content

Instantly share code, notes, and snippets.

@conschneider
Forked from tatemz/docker-wordpress.sh
Last active June 15, 2017 15:43
Show Gist options
  • Save conschneider/a3c622b96f466edac556bd641c0ee641 to your computer and use it in GitHub Desktop.
Save conschneider/a3c622b96f466edac556bd641c0ee641 to your computer and use it in GitHub Desktop.
A quick way to get a WordPress installation up and running with Docker. Mounts the WordPress root folder as well for exchange between host and Docker container.
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb:
image: mariadb
ports:
- "8081:3306"
environment:
MYSQL_ROOT_PASSWORD: ChangeMeIfYouWant
my-wp:
image: wordpress
volumes:
- ./:/var/www/html
ports:
- "8080:80"
links:
- my-wpdb:mysql
environment:
WORDPRESS_DB_PASSWORD: ChangeMeIfYouWant
EOL
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment