Tag: 量angular器

在Docker中运行busybox httpd的angular2 webpack应用程序

基本上它看起来像它的作品….除了当你重新加载页面。 我已经构build了一个简单的ng2应用程序,并将它打包到一个文件结构如下的webpack: ./dist – index.html – inline.bundle.map – main.bundle.js – main.bundle.map – styles.bundle.js – styles.bundle.map – vendor.bundle.js – vendor.bundle.map 如果我使用PHP的构build服务器来承载这样的网站: $ cd ~/dist $ php -S localhost:8000 该网站工作正常。 如果我把相同的代码放在我的docker镜像中,像这样: FROM busybox:latest ENV HOME /client/ WORKDIR ${HOME} COPY ./dist ${HOME} EXPOSE 80 CMD [ "httpd", "-fv"] …build立图像,并像这样运行: docker run -d -p 8080:80 site:latest 按照预期,该站点可以在127.0.0.1:8080访问。 然而(这是我无法解决的问题)。 由于ng2应用程序使用@angular度/路由器,页面加载时页面url从127.0.0.1:8080更新到127.0.0.1:8080/namedroute。 […]

如何在Docker机器上运行Angular 2应用程序?

我已经部署了简单的angular度2应用程序,它是使用angular-cli创build的,在构builddocker映像后,我将它运行在虚拟盒子容器上 应用程序正在容器上运行,并暴露于端口也,但如果我试图访问该url,获取网站无法到达。 下面是我的dockerfile FROM node:boron # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ RUN npm install # Bundle app source COPY . /usr/src/app EXPOSE 5655 CMD [ "npm","start" ] 的package.json { "name": "baconv1", "scripts": { "ng": "ng", "start": "ng serve -H 0.0.0.0" …. …. } 即使在package.json我尝试了两种方法设置开始为"ng […]

在Docker中创build一个ng-cli容器不工作

我正在与angular2和docker工人,并试图build立一个形象。 当我进入“docker build -t angular-client:dev”。 一切似乎工作,但是当我运行angular客户端来尝试创build一个容器,它开始,而不是停止。 请有人帮我解决这个问题….. **My dockerfile** # 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 […]

错误:HTTP请求响应时间

我会解释一下我的情况,我实际上有一个客户端+网关+服务器的体系结构,我试图从客户端发送数据集到服务器端,它需要通过网关获得encryption,所以它会被储存起来。 我正在使用HElib(同态encryption库)。 客户端与Angular2和后端与GoLang,我使用每个服务的docker集装箱,意味着我有一个: 客户端容器 网关容器 服务器容器 encryption容器 解密容器 我现在面临的问题是这一个,当我从客户端发送数据集到服务器,它通过网关(一切都很好,直到现在),它调用encryption容器来encryption每个数据从数据集,我遇到的问题是encryption容器退出代码139,有时它会显示我这样的错误之前退出:fftRep:不一致的使用。 问题是,当我在每个请求之后提出一个破解点时,每个东西都在工作,意味着问题来自于发送到encryption容器的众多请求,迫使他停下来。 这是我的Angular2代码:我提出的突破点是: for(var i = 0;i<this.DataSet.length;i++){ var myTrainingData = new TrainingData; myTrainingData.sepal_length = String(this.DataSet[i][0]); myTrainingData.sepal_width = String(this.DataSet[i][1]); myTrainingData.petal_length =String(this.DataSet[i][2]); myTrainingData.petal_width = String(this.DataSet[i][3]); myTrainingData.species = String(this.DataSet[i][4]); if(this.treatState == true){ this.surveyService.sendTrainingData(myTrainingData) .subscribe( data => { this.treatState = false; this.loading = false; if(data.Success){ this.alertService.success("Training done !"+i); console.log(i); } else{ […]

如何使用Docker容器将HTML5模式的angular2应用程序部署

如何在Docker容器中部署angular2应用程序, 目前我正在使用快递节点js来服务我的应用内容, index.js // set server port. SERVER_PORT varibale will come from Dockerfile var port = process.env.SERVER_PORT; if (!port) { port = 3000; } // set internal communication url global.internalURL = "http://localhost:" + port; var path = require('path'); var express = require('express'); var app = express(); var bodyParser = require("body-parser"); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); […]

使用Spinnaker从dockerhub部署Docker镜像到Aws Eb

Spinnaker / Docker非常新。 我们正在尝试使用Spinnaker来简单地检索已推送到hub.docker.com的Docker映像,并将其部署到AWS Elastic Beanstalk中的应用程序。 我们的三angular帆服务器运行在EC2的虚拟机上。 我们希望使用大三angular帆,因为它支持带批准链的负载均衡部署等。 围绕这个主题的唯一参考文章涉及Kubernetes,这是我不熟悉的另一个平台。 我很困惑,因为从逻辑上讲,从dockerhub中提取Docker镜像并将其部署到Aws应该是这种基本的部署forms之一。 任何帮助,将不胜感激。

Angular2在Docker中找不到module:'./class'

我正在为使用Gitlab和Docker的angular2应用程序构build自动部署平台。 该项目基于https://akveo.github.io/ng2-admin/ 我对模板项目做了一些修改,即添加一些我自己的服务和模型。 在我的app目录中,我添加了一个servics和models目录。 服务/ example.service.ts: import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import { Example } from '../models/Example'; @Injectable() export class ExampleService { private BaseUrl = 'http://localhost:6969/api/1.0/example' constructor(private http: Http) {} Example(Payload: string) { //do stuff } } 车型/ example.ts export class Example{ ID: number; //etc } Docker Image:节点 […]

在运行时优化ng build

我已经开发了一个小的Angular应用程序,我已经打包成一个容器。 这个应用程序利用Angular的“环境”,所以我可以build立使用各种 – –environment=标志(如test , dev , prod )。 考虑到我想维护一个docker镜像,并在run时使用适当的标志,我build立了一个小的入口点脚本,基本上做了ng build –environment=$UI_ENV并最终启动nginx。 UI_ENV是我在docker run传递给容器的variables。 这工作得很好,但缺点是容器需要15至20秒来编译angular度的应用程序,并最终启动nginx(由于编译时间)。 我只是想知道这是否是最好的方法(在我所描述的范围内)。 或者如果这是最好的可以做到的。 谢谢。

net :: ERR_CONTENT_LENGTH_MISMATCH在docker云上的​​angular度2上

我得到一个净:: ERR_CONTENT_LENGTH_MISMATCH main.bundle.js在docker云上运行angular2,同样的工作在我的本地docker实例 以下是docker文件 FROM node RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY . /usr/src/app RUN npm install 和docker工作 version: '2' services: app: build: . volumes: – ./:/usr/src/app ports: – 4200:4200 – 49153:49153 command: npm start 任何线索,为什么会发生这将有很大的帮助

在Docker上运行angular2 springboot应用程序,它显示索引页面,但没有加载angular度

我无法在docker上运行springboot angular2前端。 Angular2没有加载与docker战争容器,不明白为什么 <build> <finalName>${project.artifactId}</finalName> <defaultGoal>spring-boot:run</defaultGoal> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>1.2.7.RELEASE</version> <configuration> <addResources>src/main/webapp</addResources> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.5.0</version> <executions> <execution> <id>install angular2-contextmenu</id> <configuration> <executable>npm</executable> <arguments> <argument>install</argument> </arguments> </configuration> <phase>generate-resources</phase> <goals> <goal>exec</goal> </goals> </execution> <execution> <id>install npm</id> <configuration> <executable>npm</executable> <arguments> <argument>install</argument> </arguments> </configuration> <phase>generate-resources</phase> <goals> <goal>exec</goal> </goals> </execution> <execution> <id>build js</id> <configuration> <executable>npm</executable> <arguments> <argument>run</argument> […]