version: '3'
name: zeppelin-dev
volumes:
  home: {}
services:
  nginx:
    build:
      context: ./docker/development/nginx
      args:
        DEVELOPMENT_WEB_PORT: ${DEVELOPMENT_WEB_PORT:?Missing DEVELOPMENT_WEB_PORT}
    ports:
      - "${DEVELOPMENT_WEB_PORT:?Missing DEVELOPMENT_WEB_PORT}:443"

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: ${DEVELOPMENT_MYSQL_ROOT_PASSWORD?:Missing DEVELOPMENT_MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: zeppelin
      MYSQL_USER: zeppelin
      MYSQL_PASSWORD: ${DEVELOPMENT_MYSQL_PASSWORD?:Missing DEVELOPMENT_MYSQL_PASSWORD}
    ports:
      - ${DEVELOPMENT_MYSQL_PORT:?Missing DEVELOPMENT_MYSQL_PORT}:3306
    volumes:
      - ./docker/development/data/mysql:/var/lib/mysql
    command: --authentication-policy=mysql_native_password

  devenv:
    build:
      context: ./docker/development/devenv
      args:
        DEVELOPMENT_SSH_PASSWORD: ${DEVELOPMENT_SSH_PASSWORD:?Missing DEVELOPMENT_SSH_PASSWORD}
        DEVELOPMENT_UID: ${DEVELOPMENT_UID:-1000}
    ports:
      - "${DEVELOPMENT_SSH_PORT:?Missing DEVELOPMENT_SSH_PORT}:22"
    volumes:
      - home:/home/ubuntu
      - ./:/workspace/zeppelin
