version: "3.4"

services:
  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    ports:
      - 3309:3306
    environment:
      MYSQL_DATABASE: sldb
      MYSQL_ROOT_PASSWORD: example

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

  server:
    depends_on:
      - db
    # image: node:10
    build: "./packages/server"
    user: "node"
    working_dir: /home/node/app
    environment:
      - NODE_ENV=development
    volumes:
      - ./:/home/node/app
    ports:
      - 3003:3000
    command: "yarn workspace sl-server start"

  webclient:
    depends_on:
      - server
    image: node:10
    user: "node"
    working_dir: /home/node/app
    environment:
      - NODE_ENV=development
    volumes:
      - ./:/home/node/app
    ports:
      - 4200:4200
    command: "yarn workspace sl-webclient start:container"
