Skip to content

Instantly share code, notes, and snippets.

@mvasin
Last active January 31, 2018 16:02
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 mvasin/65f21fec323648dc455c024e3b0a59ef to your computer and use it in GitHub Desktop.
Save mvasin/65f21fec323648dc455c024e3b0a59ef to your computer and use it in GitHub Desktop.
A way to start bedrock-flavoured WordPress site in Docker
# A way to quickly start bedrock-flavored (see roots.io) WordPress site in Docker
# Here are the steps:
# - Add `127.0.0.1 your-site.com` to /etc/hosts files with `sudo nano /etc/hosts`
# - Save this file as docker-compose.yml in the root of your project (along with composer.json)
# - Put your database to db.sql in the root of the project, if any
# - Execute `docker-compose up -d`
# - Wait for approximately 10-100 seconds
# - Navigate to `localhost`
version: "3"
services:
mysql:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: wordpress
volumes:
- $PWD/db.sql:/docker-entrypoint-initdb.d/db.sql
wordpress:
image: wordpress
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_PASSWORD: secret
WORDPRESS_DB_NAME: wordpress
# roots
DB_NAME: wordpress
DB_USER: root
DB_PASSWORD: secret
DB_HOST: mysql
ports: ["80:80"]
volumes:
- $PWD/web:/var/www/html
- $PWD:/var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment