version: "3.9"

services:
  frontend:
    image: alswl/excalidraw:v0.17.3-fork-b1
    container_name: excalidraw-frontend
    environment:
      - VITE_APP_BACKEND_V2_GET_URL=https://<storage_link_reverse_proxy>/api/v2/scenes/
      - VITE_APP_BACKEND_V2_POST_URL=https://<storage_link_reverse_proxy>/api/v2/scenes/
      - VITE_APP_WS_SERVER_URL=wss://<room_link_reverse_proxy> 

      - VITE_APP_HTTP_STORAGE_BACKEND_URL=https://<storage_link_reverse_proxy>/api/v2
      - VITE_APP_STORAGE_BACKEND=https
    ports:
      - "5749:80"
    restart: always

  storage:
    image: kiliandeca/excalidraw-storage-backend
    container_name: excalidraw-storage
    environment:
      - PORT=8081
      - GLOBAL_PREFIX=/api/v2
      - STORAGE_URI=mysql://root:password@mysql:8003/excalidraw 
      - LOG_LEVEL=warn
    ports:
      - "8081:8081"
    restart: always

  room:
    image: excalidraw/excalidraw-room:sha-49bf529
    container_name: excalidraw-room
    ports:
      - "8082:80"
    restart: always

  mysql:
    image: mysql
    container_name: mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=excalidraw
    ports:
      - "8003:3306"
    restart: always
