Skip to content
Snippets Groups Projects
docker-compose.yml.twig 8.08 KiB
Newer Older
  • Learn to ignore specific revisions
  • jurgenhaas's avatar
    jurgenhaas committed
    
    services:
      mariadb:
    
        image: 'wodby/mariadb:10.5'
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          MYSQL_ROOT_PASSWORD: password
          MYSQL_DATABASE: drupal
          MYSQL_USER: drupal
          MYSQL_PASSWORD: drupal
    
      php:
    
        image: 'wodby/drupal-php:{{ php.version }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
    
          DB_HOST: mariadb
          DB_USER: drupal
          DB_PASSWORD: drupal
          DB_NAME: drupal
          DB_DRIVER: mysql
    
          COMPOSER_ALLOW_SUPERUSER: 1
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if php.xdebug %}
    
    jurgenhaas's avatar
    jurgenhaas committed
          PHP_XDEBUG: 1
    
          PHP_XDEBUG_MAX_NESTING_LEVEL: 512
          PHP_XDEBUG_MODE: debug,develop
    
          PHP_XDEBUG_REMOTE_HOST: {{ docker0.ip }}
    
          PHP_XDEBUG_START_WITH_REQUEST: 1
    
          PHP_IDE_CONFIG: serverName=Docker
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if webgrind.enable %}
          PHP_XDEBUG_PROFILER_ENABLE: 1
          PHP_XDEBUG_PROFILER_ENABLE_TRIGGER: 1
          PHP_XDEBUG_PROFILER_ENABLE_TRIGGER_VALUE: 1
          PHP_XDEBUG_PROFILER_OUTPUT_DIR: /mnt/files/xdebug/profiler
          PHP_XDEBUG_TRACE_OUTPUT_DIR: /mnt/files/xdebug/traces
    {% endif %}
    {% endif %}
    {% if blackfire.enable %}
          PHP_BLACKFIRE: 1
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
    {% if php.ssh %}
    
    {% endif %}
    
    jurgenhaas's avatar
    jurgenhaas committed
        volumes:
    
          - {{ projectroot }}:/var/www/html
    
          - {{ projectroot }}/drush:/etc/drush
    
    {% if php.ssh %}
    
          - {{ php.ssh_auth_sock }}:/ssh-agent
    
    {% endif %}
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if webgrind.enable %}
          - files:/mnt/files
    
    {% endif %}
    {% if wkhtmltox.enable %}
          - './.docker-init/wkhtmltox.sh:/docker-entrypoint-init.d/50-wkhtmltox.sh'
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
        extra_hosts:
    
          - '{{ projectname }}.{{ traefik.domain }}:{{ docker0.ip }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
      {{ webserver.type }}:
    
        image: {% if webserver.type == 'nginx' %}'wodby/drupal-nginx:{{ webserver.version|default("1.18") }}'{% elseif webserver.type == 'apache' %}'wodby/apache:2.4'{% endif %}
    
    jurgenhaas's avatar
    jurgenhaas committed
    
    
    jurgenhaas's avatar
    jurgenhaas committed
        depends_on:
          - php
        environment:
    
    {% if webserver.type == 'nginx' %}
    
    {% if live is defined and live.uri is defined %}
          NGINX_DRUPAL_FILE_PROXY_URL: '{{ live.uri }}'
    {% endif %}
    
          NGINX_ERROR_LOG_LEVEL: debug
    {% elseif webserver.type == 'apache' %}
    
          APACHE_VHOST_PRESET: php
    
          APACHE_LOG_LEVEL: debug
    
    {% if webserver.overwriteconfig %}
          APACHE_INCLUDE_CONF: /var/www/html/apache/vhost.conf
    {% endif %}
    
    {% endif %}
    
          {{ webserver.type|upper }}_BACKEND_HOST: php
    
          {{ webserver.type|upper }}_SERVER_ROOT: /var/www/html/{{ webRoot }}/
    
    jurgenhaas's avatar
    jurgenhaas committed
        volumes:
    
          - {{ projectroot }}:/var/www/html
    
    jurgenhaas's avatar
    jurgenhaas committed
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
    jurgenhaas's avatar
    jurgenhaas committed
          traefik.http.routers.{{ projectname }}_{{ webserver.type }}.rule: Host(`{{ projectname }}.{{ traefik.domain }}`){% for domain in extradomains|default([]) %} || Host(`{{ domain }}`){% endfor %}
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if varnish.enable %}
    
    jurgenhaas's avatar
    jurgenhaas committed
      varnish:
    
        image: 'wodby/varnish:4.1'
    
    jurgenhaas's avatar
    jurgenhaas committed
        depends_on:
    
          - {{ webserver.type }}
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          VARNISH_SECRET: secret
    
          VARNISH_BACKEND_HOST: {{ webserver.type }}
    
    jurgenhaas's avatar
    jurgenhaas committed
          VARNISH_BACKEND_PORT: 80
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.routers.{{ projectname }}_varnish.rule: Host(`varnish-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
      redis:
    
        image: 'wodby/redis:{{ redis.version }}'
    
    
    {% if dbbrowser.type == 'adminer' %}
    
        image: 'wodby/adminer:{{ dbbrowser.version|default("4.7") }}'
    
        environment:
          ADMINER_SALT: adminer-salt
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_adminer.loadbalancer.server.port: 9000
          traefik.http.routers.{{ projectname }}_adminer.rule: Host(`adminer-{{ projectname }}.{{ traefik.domain }}`)
    
    {% elseif dbbrowser.type == 'pma' %}
    
    jurgenhaas's avatar
    jurgenhaas committed
      pma:
    
        image: 'phpmyadmin/phpmyadmin:5'
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          PMA_HOST: mariadb
          PMA_USER: drupal
          PMA_PASSWORD: drupal
          PHP_UPLOAD_MAX_FILESIZE: 1G
          PHP_MAX_INPUT_VARS: 1G
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.routers.{{ projectname }}_pma.rule: Host(`pma-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if solr.enable %}
    
    jurgenhaas's avatar
    jurgenhaas committed
      solr:
    
        image: 'wodby/solr:8-{{ solr.version }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          SOLR_HEAP: 1024m
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_solr.loadbalancer.server.port: 8983
          traefik.http.routers.{{ projectname }}_solr.rule: Host(`solr-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
      mailhog:
    
        image: 'mailhog/mailhog'
    
    jurgenhaas's avatar
    jurgenhaas committed
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_mailhog.loadbalancer.server.port: 8025
          traefik.http.routers.{{ projectname }}_mailhog.rule: Host(`mailhog-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if node.enable %}
    
      nodejs:
    
        image: 'wodby/drupal-node:1.0'
    
        environment:
           NODE_SERVICE_KEY: '{{ node.key }}'
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_nodejs.loadbalancer.server.port: 8080
          traefik.http.routers.{{ projectname }}_nodejs.rule: Host(`nodejs-{{ projectname }}.{{ traefik.domain }}`)
    
        volumes:
    
          - {{ projectroot }}/{{ node.path }}:/app
    
        command: sh -c 'npm install && npm run start'
    
    
    jurgenhaas's avatar
    jurgenhaas committed
      node:
    
        image: 'node:alpine'
    
    jurgenhaas's avatar
    jurgenhaas committed
        working_dir: /app
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_node.loadbalancer.server.port: 3000
          traefik.http.routers.{{ projectname }}_node.rule: Host(`front-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
        expose:
    
    jurgenhaas's avatar
    jurgenhaas committed
        volumes:
    
          - {{ projectroot }}/{{ node.path }}:/app
    
    jurgenhaas's avatar
    jurgenhaas committed
        command: sh -c 'npm install && npm run start'
    {% endif %}
    
    {% if memcached.enable %}
    
      memcached:
    
        image: 'wodby/memcached:1.6'
    
    {% endif %}
    {% if rsyslog.enable %}
    
      rsyslog:
        image: 'wodby/rsyslog'
    {% endif %}
    {% if athenapdf.enable %}
    
      athenapdf:
        image: 'arachnysdocker/athenapdf-service'
        environment:
          WEAVER_AUTH_KEY: '{{ athenapdf.key }}'
    
          WEAVER_MAX_WORKERS: 10
          WEAVER_MAX_CONVERSION_QUEUE: 50
          WEAVER_WORKER_TIMEOUT: 90
          WEAVER_CONVERSION_FALLBACK: false
    {% endif %}
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% if blackfire.enable %}
    
      blackfire:
        image: 'blackfire/blackfire'
        environment:
          BLACKFIRE_SERVER_ID: '{{ blackfire.id }}'
          BLACKFIRE_SERVER_TOKEN: '{{ blackfire.token }}'
    {% endif %}
    {% if webgrind.enable %}
    
      webgrind:
        # add XDEBUG_PROFILE=1 to your request to profile that
    
        image: 'wodby/webgrind:1.7'
    
    jurgenhaas's avatar
    jurgenhaas committed
        environment:
          WEBGRIND_PROFILER_DIR: '/mnt/files/xdebug/profiler'
        labels:
    
          traefik.enable: true
          traefik.network: {{ projectname }}
    
          traefik.http.services.{{ projectname }}_webgrind.loadbalancer.server.port: 8080
          traefik.http.routers.{{ projectname }}_webgrind.rule: Host(`webgrind-{{ projectname }}.{{ traefik.domain }}`)
    
    jurgenhaas's avatar
    jurgenhaas committed
        volumes:
    
          - {{ projectroot }}/files:/mnt/files
    
    jurgenhaas's avatar
    jurgenhaas committed
    {% endif %}
    
        image: 'tianon/true'
        entrypoint: '/true'
        #image: 'elgalu/selenium'
    
        volumes:
          - /dev/shm:/dev/shm
        privileged: true
        environment:
    
          SELENIUM_HUB_HOST: 'hub'
          SELENIUM_HUB_PORT: '4444'
          GRID: 'true'
          CHROME: 'false'
          FIREFOX: 'false'
    
        image: 'tianon/true'
        entrypoint: '/true'
        #image: 'elgalu/selenium'
    
        depends_on:
          - hub
        volumes:
          - /dev/shm:/dev/shm
        privileged: true
        environment:
    
          NOVNC: 'true'
          SELENIUM_HUB_HOST: 'hub'
          SELENIUM_HUB_PORT: '4444'
          SELENIUM_NODE_HOST: '{{ docker0.ip }}'
          SCREEN_WIDTH: '1300'
          SCREEN_HEIGHT: '999'
          VIDEO: 'false'
          GRID: 'false'
          CHROME: 'true'
          FIREFOX: 'false'
    
        #ports:
          # VNC: See what's going on by connecting your VNC client to 0.0.0.0:5900
          #- 5900:25900
          # noVNC: See what's going on by hitting http://0.0.0.0:6080 in your browser
          #        Important: http://127.0.0.1:6081 works but http://localhost:6081 doesn't
          #- 6080:26080
    
    
    networks:
      default:
        external:
          name: traefik_{{ projectname }}