version: "2.4"
services:
  mobicoop_platform:
    container_name: mobicoop_platform
    image: mobicoop/php-node-chromium:2.0.0
    # build: ./
    ports:
      - "9000:9000"
      - "8079:8079"
      - "8080:8080"
      - "8081:8081"
      - "8082:8082"
    working_dir: /var/www
    command: npm start
    # entrypoint: ["bash", "/var/www/docker/api_bdd_import.sh"]
    # entrypoint: bash /docker/api_entrypoint.sh
    depends_on:
      - db
    tty: true
    environment:
      - COMPOSER_PROCESS_TIMEOUT=1200
    volumes:
      - ./:/var/www/:cached
      - ./build/cache:/root/.cache/:cached
    networks:
      - mobicoop_platform

  db:
    image: mariadb:10.4
    #command: --max_allowed_packet=512000000
    container_name: mobicoop_db
    restart: always
    ports: ["3309:3306"]
    environment:
      MYSQL_ROOT_PASSWORD: mobicoop
    volumes:
      - ./.mariadb-data:/var/lib/mysql
    networks:
      mobicoop_platform:
        aliases:
          - db_platform

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: mobicoop_phpmyadmin
    depends_on:
      - db
    environment:
      PMA_PORT: 3309
      MYSQL_USERNAME: root
      MYSQL_ROOT_PASSWORD: mobicoop
    restart: always
    ports:
      - "8083:80"
    networks:
      - mobicoop_platform

networks:
  mobicoop_platform:
    name: mobicoop_platform
