version: '3.7'
services:
  db:
    image: mariadb:10
    volumes:
      - ./compose/db/config.cnf:/etc/mysql/conf.d/config.cnf
      - ./compose/db/init.sql:/docker-entrypoint-initdb.d/init.sql
      - ./compose/db/data/db:/var/lib/mysql
    env_file:
      - ./compose/db/env
    ports:
      - 127.0.0.1:3306:3306

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

  api:
    build:
      context: ./compose/api
    volumes:
      - ./packages/api:/var/www/html
      - ./compose/api/data/apache/logs/:/var/log/apache2
    ports:
      - 127.0.0.1:8081:80

  spa:
    image: node:10
    restart: always
    working_dir: /spa
    command: tail -f /dev/null # keep container running
    volumes:
      - ./packages/spa:/spa
    ports:
      - 127.0.0.1:8080:8080

  jsclient:
    image: node:10
    restart: always
    working_dir: /js-client
    command: tail -f /dev/null # keep container running
    volumes:
      - ./packages/js-client:/js-client
