Skip to content

Instantly share code, notes, and snippets.

@dpliakos
Created July 29, 2018 14:51
Show Gist options
  • Save dpliakos/7b1cac653c6c78c54172ce77ff095aca to your computer and use it in GitHub Desktop.
Save dpliakos/7b1cac653c6c78c54172ce77ff095aca to your computer and use it in GitHub Desktop.
version: "2"
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
volumes:
- ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
# - /path/to/mariadb/data/on/host:/var/lib/mysql # I want to manage volumes manually.
php:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: $DB_HOST
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
DB_DRIVER: $DB_DRIVER
## Read instructions at https://wodby.com/stacks/drupal/docs/local/xdebug/
# PHP_XDEBUG: 1
# PHP_XDEBUG_DEFAULT_ENABLE: 1
# PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
# PHP_IDE_CONFIG: serverName=my-ide
# PHP_XDEBUG_REMOTE_HOST: host.docker.internal # Docker 18.03+ & Linux/Mac/Win
# PHP_XDEBUG_REMOTE_HOST: 172.17.0.1 # Linux, Docker < 18.03
# PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS, Docker < 18.03
# PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows, Docker < 18.03
volumes:
- ./:/var/www/html
## For Xdebug profiler files
# - files:/mnt/files
apache:
image: wodby/php-apache:$APACHE_TAG
container_name: "${PROJECT_NAME}_apache"
depends_on:
- php
environment:
APACHE_LOG_LEVEL: debug
APACHE_BACKEND_HOST: php
APACHE_SERVER_ROOT: /var/www/html/public_html
volumes:
- ./:/var/www/html
# For macOS users (https://wodby.com/stacks/drupal/docs/local/docker-for-mac/)
# - ./:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
labels:
- 'traefik.backend=apache'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'
# nginx:
# image: wodby/drupal-nginx:$NGINX_TAG
# container_name: "${PROJECT_NAME}_nginx"
# depends_on:
# - php
# environment:
# # NGINX_PAGESPEED: "on"
# NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
# NGINX_ERROR_LOG_LEVEL: debug
# NGINX_BACKEND_HOST: php
# NGINX_SERVER_ROOT: /var/www/html/web
# # NGINX_DRUPAL_FILE_PROXY_URL: http://example.com
# volumes:
# - ./:/var/www/html
portainer:
image: portainer/portainer
container_name: "${PROJECT_NAME}_portainer"
command: --no-auth -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- 'traefik.backend=portainer'
- 'traefik.port=9000'
- 'traefik.frontend.rule=Host:portainer.${PROJECT_BASE_URL}'
traefik:
image: traefik
container_name: "${PROJECT_NAME}_traefik"
command: -c /dev/null --web --docker --logLevel=INFO
ports:
- '8000:80'
# - '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
#volumes:
## Docker-sync for macOS users
# docker-sync:
# external: true
## For Xdebug profiler
# files:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment