Skip to content

Instantly share code, notes, and snippets.

@varinen
Created June 21, 2020 07:09
Show Gist options
  • Save varinen/c47c24c7f44566439a67ec8b593d8cf1 to your computer and use it in GitHub Desktop.
Save varinen/c47c24c7f44566439a67ec8b593d8cf1 to your computer and use it in GitHub Desktop.
version: "3"
services:
db_node_domain:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: password
container_name: wordpress_db
wordpress:
depends_on:
- db_node_domain
image: wordpress:latest
expose:
- 80
restart: unless-stopped
environment:
VIRTUAL_HOST: site1.yourdomain.tld
LETSENCRYPT_HOST: site1.yourdomain.tld
WORDPRESS_DB_HOST: db_node_domain:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: password
container_name: wordpress
volumes:
db_data:
networks:
default:
external:
name: nginx-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment