Skip to content

Instantly share code, notes, and snippets.

@fafshari
Last active October 21, 2021 15:53
Show Gist options
  • Save fafshari/6132ee3d65a8fcf457a4bbf58833c3e7 to your computer and use it in GitHub Desktop.
Save fafshari/6132ee3d65a8fcf457a4bbf58833c3e7 to your computer and use it in GitHub Desktop.
SITE_FILES=./data/site
DB_FILES=./data/db
# Other variables are probably not relevant for volumes
version: '3'
services:
boilerplate-db:
container_name: ${CONTAINER_DB_NAME}
image: ${DB_IMAGE:-mariadb}:${DB_VERSION:-latest}
restart: unless-stopped
volumes:
- ${DB_FILES}:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
networks:
wp:
wordpress:
build: .
container_name: ${CONTAINER_SITE_NAME}
restart: unless-stopped
ports:
- "80:80"
volumes:
- ${SITE_FILES}/uploads:/var/www/html/wp-content/uploads
- "./themes/anyday:/var/www/html/wp-content/themes/anyday/"
- "./plugins:/var/www/html/wp-content/plugins"
- "./mu-plugins:/var/www/html/wp-content/mu-plugins"
- ./conf.d/php.ini:/usr/local/etc/php/conf.d/php.ini
environment:
WORDPRESS_DB_HOST: ${CONTAINER_DB_NAME}:3306
WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
WORDPRESS_DB_USER: ${MYSQL_USER}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX}
logging:
options:
max-size: ${LOGGING_OPTIONS_MAX_SIZE:-200k}
networks:
wp:
networks:
wp:
FROM wordpress:latest
COPY plugins /var/www/html/wp-content/plugins
COPY mu-plugins /var/www/html/wp-content/mu-plugins
COPY themes/anyday /var/www/html/wp-content/themes/anyday
file_uploads=On
memory_limit=64M
upload_max_filesize=64M
post_max_size=64M
max_execution_time=600
expose_php=Off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment