首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角度为2的Docker :无法获取

角度为2的Docker :无法获取
EN

Stack Overflow用户
提问于 2017-06-09 18:55:09
回答 0查看 610关注 0票数 1

遵循本教程,我们将尝试使用Docker设置一个Angular 2应用程序:https://scotch.io/tutorials/create-a-mean-app-with-angular-2-and-docker-compose

应用程序被部署,但是我们得到'Cannot get /‘

这是我们如何构建我们的应用程序:

代码语言:javascript
复制
sudo docker build -t frontend:dev .

这就是我们运行应用程序的方式

代码语言:javascript
复制
sudo docker run -d --name frontend -p 1014:4200 frontend:dev

我们的dockerfile与教程完全相同:

代码语言:javascript
复制
# Create image based on the official Node 6 image from dockerhub
FROM node:6

# Create a directory where our app will be placed
RUN mkdir -p /usr/src/app

# Change directory so that our commands run inside this new directory
WORKDIR /usr/src/app

# Copy dependency definitions
COPY package.json /usr/src/app

# Install dependecies
RUN npm install

# Get all the code needed to run the app
COPY . /usr/src/app

# Expose the port the app runs in
EXPOSE 4200

# Serve the app
CMD ["npm", "start"]

这是package.json的摘录

代码语言:javascript
复制
{
  "name": "courseka",
  "version": "0.0.0",
  "scripts": {
    "start": "ng serve -H 0.0.0.0"
    "build": "ng build"
  }
}

最后,我们的index.html文件中的一些内容

代码语言:javascript
复制
<html>
  <head>
    <base href="/">
  </head>
</html>
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44455983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档