version: '3.8'

services:
  web:
    build:
      context: .
      dockerfile: ./nuxt/Dockerfile
    container_name: "prodio-web"
    ports:
      - "6061:3000"
    volumes:
      - ./nuxt/app:/app
    networks:
      - internal
  api:
    # image: krisss/docker-webman:8.2-cli-alpine
    build:
      context: .
      dockerfile: ./webman/Dockerfile
    container_name: "prodio-api"
    ports:
      - "6065:8787"
    volumes:
      - ./app:/app
    networks:
      - internal
  mysql:
    build:
      context: .
      dockerfile: ./mysql/Dockerfile
    container_name: "prodio-mysql"
    # ports:
    #  - "3306:3306"
    networks:
      - internal
    volumes:
      - ./data/mysql/data:/var/lib/mysql
      - ./data/mysql/init:/docker-entrypoint-initdb.d
    environment:
      MYSQL_ROOT_PASSWORD: 1qazvfr4  
  # redis:
  #   image: redis
  #   container_name: "prodio-redis"
  #   networks:
  #     - internal
  mail:
    image: boky/postfix
    container_name: "prodio-mail"
    environment:
      - ALLOW_EMPTY_SENDER_DOMAINS=true
      # - ALLOWED_SENDER_DOMAINS=prodio.com.tw
      - POSTFIX_always_add_missing_headers=yes
      - HOSTNAME=zltest.com.tw # set to the hostname of the server
    networks:
      - internal
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: "prodio-myadmin"
    ports:
      - "6069:80"
    networks:
      - internal
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      UPLOAD_LIMIT: 100M
networks:
  internal:
    driver: bridge
