Skip to content

Instantly share code, notes, and snippets.

@yehanny
Forked from pablokbs/docker-compose-wordpress.yaml
Last active December 28, 2020 21:43
Show Gist options
  • Save yehanny/899cd3dddc9c6aab919ecb7287bd264e to your computer and use it in GitHub Desktop.
Save yehanny/899cd3dddc9c6aab919ecb7287bd264e to your computer and use it in GitHub Desktop.
Docker-compose para wordpress con mysql
## docker-compose para correr wordpress con una base de datos en mysql
## by PeladoNerd https://youtu.be/eoFxMaeB9H4
version: "3.8"
services:
wordpress:
image: wordpress:latest
container_name: wp_site_name
ports:
- 8080:80
environment:
- WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST}
- WORDPRESS_DB_USER=${WORDPRESS_DB_USER}
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD}
- WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME}
links:
- mysql:mysql
mysql:
image: mysql:8.0
container_name: mysql80
# Use this command if the mysql is >= 8.0
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "3307:3306"
volumes:
- ~/docker/mysql-data:/var/lib/mysql
# Dump database from .sql backup, use only on first installation
# - ~/my_local_destination/dump.sql:/docker-entrypoint-initdb.d/dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment