Skip to content

docker compose.yml

Oleksandr Horbatiuk edited this page Mar 8, 2024 · 4 revisions
version: "3.7"

services:
  mariadb:
    image: "wodby/mariadb:${MARIADB_TAG}"
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 7200s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD
      MYSQL_WAIT_TIMEOUT: 7200
    ports:
    - "${DB_PORT}:${DB_PORT}"
    volumes:
    - db_data:/var/lib/mysql

  php:
    image: "wodby/drupal-php:${PHP_TAG}"
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_MAIL_MIXED_LF_AND_CRLF: On
      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'
      PHP_XDEBUG: 1
      PHP_XDEBUG_MODE: debug
      PHP_IDE_CONFIG: serverName=my-ide
      PHP_XDEBUG_IDEKEY: "my-ide"
      PHP_XDEBUG_CLIENT_HOST: host.docker.internal
      PHP_XDEBUG_LOG: /dev/null
    volumes:
    - ./:/var/www/html:cached

  nginx:
    image: "wodby/nginx:${NGINX_TAG}"
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
    - php
    environment:
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_SERVER_ROOT: /var/www/html
      NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
    volumes:
    - ./:/var/www/html:cached
    labels:
    - "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"

  mailhog:
    image: mailhog/mailhog
    container_name: "${PROJECT_NAME}_mailhog"
    labels:
    - "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
    - "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"

  traefik:
    image: traefik:v2.0
    container_name: "${PROJECT_NAME}_traefik"
    command: --api.insecure=true --providers.docker
    ports:
    - "${PROJECT_PORT}:${PROJECT_PORT}"
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock

volumes:
  db_data:
Clone this wiki locally