version: '3'

networks:
  default:
    external:
      name: crm_project

services:
  mysql:
    image: mysql:5.6.40
    restart: unless-stopped
    ports:
      - "3306:3306"
    tty: true
    environment:
      - MYSQL_ROOT_PASSWORD=root
    volumes:
      - ./dbdata:/var/lib/mysql/
      - ./mysql/my.cnf:/etc/mysql/my.cnf

  express:
    build: .
    command: sh -c 'npm run start:dev'
    ports:
      - '3000:3000'
    volumes:
      - .:/usr/app/
      - /usr/app/node_modules
    tty: true
