赞
踩
源码地址: https://github.com/xbmlz/nuxt-starter.git
{ "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "preview": "nuxt preview", "start": "node .output/server/index.mjs", "generate": "nuxi generate" }, "dependencies": { "@element-plus/icons-vue": "^1.1.4", "@nuxtjs/axios": "^5.13.6", "element-plus": "^2.2.0", "pinia": "^2.0.14", "vue": "^3.2.33" }, "devDependencies": { "@iconify/vue": "^3.2.1", "@pinia/nuxt": "^0.1.9", "@vueuse/nuxt": "^8.4.2", "@windicss/plugin-animations": "^1.0.9", "nuxt": "3.0.0-rc.3", "nuxt-windicss": "^2.3.1", "sass": "^1.51.0" } }
新增Dockerfile
文件如下
FROM node:14-alpine RUN mkdir -p /app WORKDIR /app COPY package.json /app/ RUN RUN npm i --registry=https://registry.npm.taobao.org RUN npm run build COPY ./.output /app/.output EXPOSE 9000 ENTRYPOINT ["npm", "run", "start"]
新增docker-compose.yml
文件如下
version: "3"
services:
service_nuxt:
image: nuxtapp:0.0.0
container_name: nuxtapp
build:
context: ./
ports:
- "3000:3000"
environment:
- TZ: Asia/Shanghai
启动容器
docker-compose up -d --build
停止容器
docker-compose stop
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。