version: "3.4"

services:
  mysql:
    image: mysql:5.6
    environment:
      - MYSQL_DATABASE
      - MYSQL_ROOT_PASSWORD
      - MYSQL_USER
      - MYSQL_PASSWORD
    volumes:
      - "./mysql:/var/lib/mysql:rw"
      - "./docker/mysql/init_db_d:/docker-entrypoint-initdb.d"
  memorekall-member:
    build: ./docker/symfony
    depends_on:
      - mysql
      - legacy
    environment:
      - MYSQL_DATABASE
      - MYSQL_USER
      - MYSQL_PASSWORD
    volumes:
      - $PWD:/sites/memorekall/www/web_dev:rw
    networks:
      - default
      - legacy

  legacy:
    build: ./docker/legacy
    depends_on:
      - mysql
    environment:
      - MEMBER_URL_EXTERNAL
      - FRONT_URL_EXTERNAL
      - LEGACY_PROJECT_DELETION_ENABLED
    volumes:
      - $PWD/legacy:/sites/memorekall/www/web_legacy:rw
      - $PWD/log:/sites/memorekall/www/log:rw
      - ${LEGACY_SRC_SHARED}:/sites/memorekall/www/web_legacy/shared:ro
    networks:
      - legacy
networks:
  legacy:
