version: '3'
services:
  app:
    image: resolved-node:test
    ports:
      - "3100:3000"
    networks:
      - test-network
    restart: unless-stopped
    depends_on:
      - db
      - rabbitmq
  db:
    image: mysql:latest
    env_file: ./.env
    container_name: mysql_test
    ports:
      # - $MYSQLDB_DOCKER_PORT:$MYSQLDB_LOCAL_PORT
      - 3307:3306
    environment:
      MYSQL_ROOT_PASSWORD: $DB_PASSWORD
      MYSQL_ROOT_USER: $DB_USER
      MYSQL_DATABASE: $DB_NAME
    networks:
      - test-network
    volumes:
      - resolved-database:$DOCKER_MYSQL_FILEPATH
  rabbitmq:
    image: rabbitmq
    env_file: ./.env
    container_name: rabbitmq_test
    ports:
      - "5672:5672"
    networks:
      - test-network
networks:
  test-network:
    driver: bridge

volumes:
  resolved-database: