feat: add Docker configuration for development (#1)

This commit is contained in:
Ashley Trinh 2025-03-28 13:33:38 -07:00 committed by GitHub
parent 0cd5a259ae
commit b0fbbe40c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 2 deletions

12
dev.Dockerfile Normal file
View file

@ -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

22
docker-compose.dev.yml Normal file
View file

@ -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

View file

@ -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"
}
}
}

View file

@ -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"
}
}
}