Skip to content

Instantly share code, notes, and snippets.

@bozdoz
Created February 27, 2019 02:33
Show Gist options
  • Save bozdoz/2e112f541302e92321f7612312f206d2 to your computer and use it in GitHub Desktop.
Save bozdoz/2e112f541302e92321f7612312f206d2 to your computer and use it in GitHub Desktop.
simple docker compose wordpress
version: '3.3'
services:
db:
image: mariadb
volumes:
- wp_db:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpass
wordpress:
image: wordpress
volumes:
# `wordpress` is a volume name; it does not make files accessible locally
- wordpress:/var/www/html
# map a local directory to the container
- ./wp-content:/var/www/html/wp-content
ports:
- 1234:80
restart: always
environment:
WORDPRESS_DB_PASSWORD: rootpass
WORDPRESS_DB_HOST: db:3306
volumes:
wp_db:
wordpress:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment