Skip to content

Instantly share code, notes, and snippets.

@benjaminpick
Created March 28, 2017 17:20
Show Gist options
  • Save benjaminpick/99d30cfa2be6a5b711ff8c1d5844f3c8 to your computer and use it in GitHub Desktop.
Save benjaminpick/99d30cfa2be6a5b711ff8c1d5844f3c8 to your computer and use it in GitHub Desktop.
PHP / MySQL combo
server:
mem_limit: 301m
image: webgriffe/docker-php-apache-base:latest
links:
- wordpress_db
ports:
- "80:80"
volumes:
- .:/var/www/html
environment:
APACHE_DOC_ROOT: /var/www/html
APACHE_DOC_ROOT_ALIAS: /local
SSMTP_MAILHUB: smtp.server.com
SSMTP_AUTH_USER: -------
SSMTP_AUTH_PASS: ------
SSMTP_USE_STARTTLS: 'yes'
mariadb-data:
image: tianon/true
volumes:
- /var/lib/mysql
wordpress_db:
mem_limit: 300m
image: mariadb
volumes_from:
- "mariadb-data"
environment:
MYSQL_DATABASE: database
MYSQL_USER: database
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password2
@benjaminpick
Copy link
Author

Warning: If you do a docker-compose pull, it will delete the data of the database. Instead, use docker-compose pull server or docker-compose pull wordpress_db to only update these images without the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment