Create Dockerfile

This commit is contained in:
henryclw
2022-04-18 23:48:19 -07:00
parent aee764c2d6
commit b78f3c6853
3 changed files with 34 additions and 1 deletions

23
Dockerfile Normal file
View File

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

View File

@@ -28,6 +28,15 @@ pnpm dev
# http://localhost:3333 # 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 感谢以下小伙伴为本项目提供的数据支持和 QA

View File

@@ -4,7 +4,7 @@
"scripts": { "scripts": {
"build": "npm run convert && vite-ssg build", "build": "npm run convert && vite-ssg build",
"convert": "esno scripts/convert.ts", "convert": "esno scripts/convert.ts",
"dev": "vite --port 3333 --open", "dev": "vite --port 3333 --open --host",
"lint": "eslint .", "lint": "eslint .",
"postinstall": "npm run convert", "postinstall": "npm run convert",
"preview": "vite preview", "preview": "vite preview",
@@ -32,6 +32,7 @@
"@types/markdown-it-link-attributes": "^3.0.1", "@types/markdown-it-link-attributes": "^3.0.1",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@vitejs/plugin-vue": "^2.3.1", "@vitejs/plugin-vue": "^2.3.1",
"@unocss/reset": "^0.6.3",
"consola": "^2.15.3", "consola": "^2.15.3",
"critters": "^0.0.16", "critters": "^0.0.16",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",