diff --git a/Dockerfile b/Dockerfile index 0c9e0a5..490df03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,7 +70,7 @@ RUN npm -w packages/server run build FROM base as run WORKDIR /home/node/app COPY --from=dep /home/node/app/ ./ -COPY package*.json docker-start.sh .git ./ +COPY package*.json docker-start*.sh .git ./ # --- prepare lib --- diff --git a/docker-compose.yml b/docker-compose.yml index 91e7b34..27ff8ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,17 @@ services: condition: service_healthy postgres: condition: service_healthy + worker: + image: sc07/canvas + build: . + environment: + - REDIS_HOST=redis://redis + - DATABASE_URL=postgres://postgres@postgres/canvas + env_file: + - .env.local + depends_on: + - canvas + command: ./docker-start-worker.sh redis: restart: always image: redis:7-alpine diff --git a/docker-start-worker.sh b/docker-start-worker.sh new file mode 100644 index 0000000..cf4853f --- /dev/null +++ b/docker-start-worker.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +npm -w packages/server run tool start_job_worker \ No newline at end of file diff --git a/packages/client/src/components/CanvasWrapper.tsx b/packages/client/src/components/CanvasWrapper.tsx index e869fca..9bed88c 100644 --- a/packages/client/src/components/CanvasWrapper.tsx +++ b/packages/client/src/components/CanvasWrapper.tsx @@ -1,4 +1,4 @@ -import { useCallback, useContext, useEffect, useRef } from "react"; +import { useCallback, useContext, useEffect, useRef, useState } from "react"; import { Canvas } from "../lib/canvas"; import { useAppContext } from "../contexts/AppContext"; import { PanZoomWrapper } from "@sc07-canvas/lib/src/renderer"; @@ -23,29 +23,56 @@ export const CanvasWrapper = () => { {config &&