node.js - 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
解决方案
推荐阅读
- reactjs - ReactJS 使用 jest spyOn 测试辅助方法
- mysql - Express js:Sequlize belongsto 返回空结果
- c++ - macOS + Qt + Intellisense 上的 Visual Studio 代码
- azure - 如何检查 Powershell 脚本是否在 Azure 中运行
- node.js - 为什么在我卸载 nvm 后,当我执行“npm install yarn -g”时,它仍然提供 nvm 相关信息?
- python - 错误问题:TypeError: 'float' object has no attribute '__getitem__'
- ruby-on-rails - 我正在使用`fcm` gem 发送推送通知,它适用于 android 但不适用于 IOS
- c++ - C++ 跟踪二进制堆中的项目
- azure-active-directory - Azure AD B2C - 通过 Graph API 注册并随后登录
- algorithm - 如何找到两个不同排列之间的最短交换序列?