首页 > 解决方案 > ERR_CONNECTION_REFUSED dockerizing Vuejs 应用程序后

问题描述

我正在尝试 dockerize 我的前端,我已经按照本教程https://vuejs.org/v2/cookbook/dockerize-vuejs-app.html

这是我的码头文件

FROM node:lts-alpine

# install simple http server for serving static content
RUN npm install -g http-server

# make the 'frontend' folder the current working directory
WORKDIR /frontend

# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./

# install project dependencies
RUN npm install

# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .

# build app for production with minification
RUN npm run build

EXPOSE 8080
CMD [ "http-server", "dist" ]

当我去localhost:8000它说该站点无法访问并且ERR_CONNECTION_REFUSED

标签: node.jsdockervue.jsvuejs2

解决方案


推荐阅读