Skip to content

Instantly share code, notes, and snippets.

@jamlfy
Created August 5, 2019 22:10
Show Gist options
  • Save jamlfy/466d389188850266882be55354e8fa58 to your computer and use it in GitHub Desktop.
Save jamlfy/466d389188850266882be55354e8fa58 to your computer and use it in GitHub Desktop.
Template Wordpress
version: '3'
services:
# MySQL image
mysql:
image: mysql:5.7
container_name: mysql5.7
restart: always
expose:
- "3306"
ports:
- 3306:3306
volumes:
- ~/.db/mysql5.7:/var/lib/mysql
networks:
- project
- shared
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: project
MYSQL_USER: admin
MYSQL_PASSWORD: admin
# Project Wordpress
project:
depends_on:
- mysql
image: wordpress:latest
volumnes:
- ./:/var/www/html/
ports:
- "80:80"
restart: always
environment:
WORDPRESS_DB_HOST: mysql:3306
WORDPRESS_DB_USER: admin
WORDPRESS_DB_PASSWORD: admin
WORDPRESS_DB_NAME: project
networks:
project:
driver: "bridge"
shared:
external:
name: shared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment