diff --git a/dev.Dockerfile b/dev.Dockerfile new file mode 100644 index 000000000..8a99104d7 --- /dev/null +++ b/dev.Dockerfile @@ -0,0 +1,12 @@ +FROM node:18 + +WORKDIR /app +COPY package.json yarn.lock ./ +RUN yarn + +WORKDIR /app/excalidraw-app +COPY excalidraw-app/package.json ./ +RUN yarn + +WORKDIR /app +COPY . /app diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 000000000..9cf5f4286 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,22 @@ +services: + excalidraw: + build: + context: . + dockerfile: dev.Dockerfile + command: yarn start:dev:docker + develop: + watch: + - action: sync + path: ./packages + target: /app/packages + ignore: + - node_modules/ + - action: sync + path: ./excalidraw-app + target: /app/excalidraw-app + ignore: + - node_modules/ + - action: rebuild + path: package.json + ports: + - 3000:3000 diff --git a/excalidraw-app/package.json b/excalidraw-app/package.json index e5dcde033..473e5093b 100644 --- a/excalidraw-app/package.json +++ b/excalidraw-app/package.json @@ -47,10 +47,11 @@ "build": "yarn build:app && yarn build:version", "start": "yarn && vite", "start:production": "yarn build && yarn serve", + "start:dev:docker": "yarn && vite --no-open --host", "serve": "npx http-server build -a localhost -p 5001 -o", "build:preview": "yarn build && vite preview --port 5000" }, "devDependencies": { "vite-plugin-sitemap": "0.7.1" } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 6f57f7e7c..591c50960 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "start": "yarn --cwd ./excalidraw-app start", "start:production": "yarn --cwd ./excalidraw-app start:production", "start:example": "yarn build:package && yarn --cwd ./examples/with-script-in-browser start", + "start:dev:docker": "yarn --cwd ./excalidraw-app start:dev:docker", "test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watch=false", "test:app": "vitest", "test:code": "eslint --max-warnings=0 --ext .js,.ts,.tsx .", @@ -85,4 +86,4 @@ "resolutions": { "strip-ansi": "6.0.1" } -} +} \ No newline at end of file