Skip to content

Instantly share code, notes, and snippets.

@goshlanguage
Last active August 9, 2019 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goshlanguage/78efeecd06d797ba503561a26d8cb816 to your computer and use it in GitHub Desktop.
Save goshlanguage/78efeecd06d797ba503561a26d8cb816 to your computer and use it in GitHub Desktop.
Simple docker-compose for LEMP
version: "3"
services:
# Uncomment for DNS Server
# bind:
# image: resystit/bind9
# ports:
# - 53:53/udp
# restart: always
# volumes:
# Uncomment for custom configurations
# - /etc/bind/conf.d/:/etc/bind/conf.d/
# Uncomment for custom zone files
# - /etc/bind/zones/:/etc/bind/zones/
#
# - /var/log/named/:/var/log/named/
db:
command: "--default-authentication-plugin=mysql_native_password"
environment:
MYSQL_ROOT_PASSWORD: wpdb_root_password
MYSQL_DATABASE: wpdb
MYSQL_USER: wpdb_user
MYSQL_PASSWORD: wpdb_password
image: mysql:8
restart: always
volumes:
# Uncomment to use your own my.cnf
# - /etc/mysql/my.cnf:/etc/mysql/my.cnf
# Preserve the data directory as a host mount
- /var/lib/mysql:/var/lib/mysql
nginx:
depends_on:
- php-fpm
- db
image: nginx:1.17.1
ports:
- "80:80"
- "443:443"
restart: always
volumes:
# Uncomment the following to override the default nginx.conf
# - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf
# put your vhosts here
- /etc/nginx/conf.d/:/etc/nginx/conf.d/
- /etc/nginx/ssl/:/etc/nginx/ssl/
# for letsencrypt (SSL)
- /etc/letsencrypt/:/etc/letsencrypt/
# put your documents here
- /var/www/:/var/www/
# save the logs to the local log directory
- /var/log/nginx/:/var/log/nginx/
php-fpm:
image: phpdockerio/php72-fpm
restart: always
volumes:
# For SMTP
# Prefer to use API driven mailer integrations, these are targets for abuse
# - /etc/ssmtp/ssmtp.conf:/etc/ssmtp/ssmtp.conf
- /var/www/:/var/www/
- /var/log/php/:/var/log/php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment