version: '3.8'

#Docker Networks
networks:
  gaido:
    driver: bridge

# Workflow
services:
  db:
    image: mariadb:10
    container_name: gaido_db
    restart: always
    tty: true
    ports:
      - "3307:3306"
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'yes'
    networks:
      - gaido

  takenplace:
    build:
      context: .
      dockerfile: ./Dockerfile
    container_name: gaido_takenplace
    volumes:
      - ./:/var/www:delegated
    ports:
      - "8080:80"
      - "9001:9001"
    depends_on:
      - db
    networks:
      - gaido

  redis:
    image: "redis:alpine"
    container_name: gaido_redis
    restart: unless-stopped
    ports:
      - "6378:6379"
    networks:
      - gaido

#  phpmyadmin:
#    image: phpmyadmin/phpmyadmin
#    container_name: phpmyadmin
#    environment:
#      PMA_HOST: db
#    restart: always
#    depends_on:
#      - db
#    ports:
#      - "8081:80"
#    volumes:
#      - /sessions
#    networks:
#      - gaido
#    links:
#      - db

  mailhog:
    image: mailhog/mailhog:latest
    container_name: gaido_mailhog
    tty: true
    ports:
      - "1025:1025"
      - "8082:8025"
    networks:
      - gaido
