From 4cb31a04411f3f33fbacf9a866bc54d13565d57a Mon Sep 17 00:00:00 2001 From: yuiseki Date: Thu, 21 Dec 2023 09:37:17 +0900 Subject: [PATCH] add Dockerfile and docker-compose.yml --- Dockerfile | 5 +++++ docker-compose.yml | 16 ++++++++++++++++ package.json | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..800c9ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM node:20-slim + +COPY . /app +WORKDIR /app +RUN npm ci diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a7142a2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +services: + base: &base + build: + context: . + dockerfile: Dockerfile + volumes: + - .:/app + working_dir: /app + http_server: + <<: *base + ports: + - 127.0.0.1:5173:5173 + command: npm run dev + style_watcher: + <<: *base + command: npm run watch-style diff --git a/package.json b/package.json index b653070..29d1ab1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "vite --host", "build": "tsc && vite build", "build-style": "npx charites build styles/charites-ai/style.yml public/style.json", "watch-style": "npx charites build -w styles/charites-ai/style.yml public/style.json",