volumes:
  yeswiki-db:
    name: yeswiki-db

services:
    yeswiki-app:
        build:
          context: ..
          dockerfile: ./docker/dockerfile
          args:
            UID: "${UID:-1000}"
            GID: "${UIS:-1000}"
        container_name: yeswiki
        volumes:
          - ..:/var/www/html
        depends_on:
          - yeswiki-db
        env_file: ./yeswiki.secrets
        user: "${UID:-1000}:${UID:-1000}"
        command: /var/www/html/docker/entrypoint.sh

    yeswiki-db:
        image: mysql:latest
        container_name: yeswiki-db
        volumes:
          - yeswiki-db:/var/lib/mysql
        env_file: ./yeswiki.secrets

    yeswiki-web:
        image: nginx:alpine
        container_name: yeswiki-web
        volumes:
          - ..:/var/www/html:ro
          - ./nginx.conf:/etc/nginx/nginx.conf:ro
        ports:
          - "8085:80"
        depends_on:
          - yeswiki-app
          - myadmin

    myadmin:
      image: phpmyadmin:latest
      container_name: myadmin
      env_file: ./yeswiki.secrets
      environment:
        PMA_HOST: yeswiki-db
        PMA_PORT: 3306
      ports:
        - "8086:80"

    mail:
      image: maildev/maildev
      container_name: mail
      ports:
        - "1080:1080"
