diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..24aee48 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:lts-alpine + +RUN apk update + +RUN apk add xdg-utils + +RUN npm install -g pnpm + +WORKDIR /app + +COPY package*.json ./ + +RUN pnpm install + +COPY . . + +# convert csv to json +# automatically executed when postinstall +RUN pnpm convert + +EXPOSE 3333 + +ENTRYPOINT ["pnpm", "dev"] \ No newline at end of file diff --git a/README.md b/README.md index 6b1ccc1..7e29c02 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ pnpm dev # http://localhost:3333 ``` +## docker + +```bash +# build +docker build . -t henryclw/cook:dev +# start, then open http://localhost:3333 +docker run -it -d --name cook_dev -p 3333:3333 henryclw/cook:dev +``` + ## 致谢 感谢以下小伙伴为本项目提供的数据支持和 QA ! diff --git a/package.json b/package.json index 2ff6759..4cfb54e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "npm run convert && vite-ssg build", "convert": "esno scripts/convert.ts", - "dev": "vite --port 3333 --open", + "dev": "vite --port 3333 --open --host", "lint": "eslint .", "postinstall": "npm run convert", "preview": "vite preview", @@ -32,6 +32,7 @@ "@types/markdown-it-link-attributes": "^3.0.1", "@types/nprogress": "^0.2.0", "@vitejs/plugin-vue": "^2.3.1", + "@unocss/reset": "^0.6.3", "consola": "^2.15.3", "critters": "^0.0.16", "cross-env": "^7.0.3",