Last active
January 31, 2018 16:02
-
-
Save mvasin/65f21fec323648dc455c024e3b0a59ef to your computer and use it in GitHub Desktop.
A way to start bedrock-flavoured WordPress site in Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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