Skip to content

Instantly share code, notes, and snippets.

@Dbof
Created October 12, 2020 22:37
Show Gist options
  • Save Dbof/88d1b43cb673644013989dfb9e3ed62b to your computer and use it in GitHub Desktop.
Save Dbof/88d1b43cb673644013989dfb9e3ed62b to your computer and use it in GitHub Desktop.
Docker-Compose config to run a Wordpress instance
version: '3.1'
services:
wordpress:
image: wordpress
container_name: wp
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
networks:
- local
db:
image: mysql:5.7
restart: "no"
container_name: wp_db
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
networks:
- local
networks:
local:
volumes:
wordpress:
db:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment