version: "3.8"

services:
  api:
    build: ./bookish-server
    depends_on:
      - db
    ports:
      - 3001:3001
    environment:
      - APIPORT=3001
      - LOGLEVEL=Debug
      - DBHOST=db
      - DBUSER=root
      - DBPASS=123pass
      - DBPORT=3306
      - BOOKSHOST=https://servicepros-test-api.herokuapp.com
  db:
    image: mysql
    ports:
      - 3306:3306
    restart: always
    volumes:
      - ./init:/docker-entrypoint-initdb.d
    environment:
      MYSQL_DATABASE: bookish
      MYSQL_ROOT_PASSWORD: 123pass
