Tag: 弹性beanstalk

AWS Elastic Beanstalk运行Grunt任务

我想在弹性beanstalk上运行一个node.js应用程序。 我有一个客户端,通过一个咕噜的工作(玉,less,concat等)构build我从git中排除此文件夹 我可以通过由grunt-cli执行的grunt-cli grunt buildClient来运行它 我在我的包dev-dependencies添加了grunt和grunt-cli 我想在启动应用程序之前运行grunt构build,我已经在.ebextensions/app.config设置了一个configuration container_commands: 01_build_client: command: grunt buildClient 我想我的cwd是/tmp/deployment/application/ 但有说Fatal error: Unable to find local grunt 。 我猜grunt-cli已经安装了,但为什么会出现这个错误呢? 我也试过在package.json的postinstall部分放下这个咕噜的工作,但是这也不行。 我如何在EBS实例上构build我的咕噜作业?

如何使用AWS Elastic Beanstalk在Node.js上永远运行

我试图永远安装在软件包中,并在Elastic Beanstalk的启动命令中使用命令“./node_modules/forever/bin/forever start app.js.但它似乎并不像开始行为而工作者线程仍然可能死亡。 任何人都会用弹性豆茎永远地运行? 需要一些build议。 谢谢。

使用端口80的AWS Elastic Beanstalk上的WebSocket问题

我正在将Heroku中的node.js应用程序迁移到在端口80上使用WebSockets的AWS Elastic Beanstalk.WebSockets在AWS Elastic Beanstalk上返回301错误,但在Heroku上不会。 要初始化WebSocket连接,请单击“ Create a new note 。 AWS Beanstalk http://default-environment.psgekxtsbd.us-west-2.elasticbeanstalk.com/ Heroku https://murmuring-shelf-40601.herokuapp.com/ 这就是我如何设置服务器上的WebSockets。 const express = require('express'); const app = express(); require("express-ws")(app); app.post("/service/create-account/", (req, res)=> {/*code in here*/}); app.ws('/:noteId/', function (ws, req) {/*code in here*/}); const port = process.env.PORT || 3000; app.listen(port); 我曾尝试在.ebextensions文件夹中添加不同的configuration, files: "/etc/nginx/conf.d/01_websockets.conf" : mode: "000644" owner: root group: […]

AWS弹性beanstalk部署因ENOMEM错误而失败

您的AWS Elastic Beanstalk部署失败: – 间歇性 – 没有真正明显的原因 第1步:检查明显的日志 /var/log/eb-activity.log Running npm install: /opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm Setting npm config jobs to 1 npm config jobs set to 1 Running npm with –production flag Failed to run npm install. Snapshot logs for more details. Traceback (most recent call last): File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module> main() File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line […]

在弹性beanstalk的container_commands中执行命令时没有path

我正在尝试在AWS Elastic Beanstalk上部署应用程序。 我在.ebextensions有以下文件: commands: 01-install-git: command: "yum install -y git &>> /tmp/deploy.log" 02-install-nodejs-npm: command: "yum install -y –enablerepo=epel nodejs npm &>> /tmp/deploy.log" 03-install-grunt: command: "npm install -g grunt-cli &>> /tmp/deploy.log" 04-install-coffee: command: "npm install -g coffee-script &>> /tmp/deploy.log" 05-install-bower: command: "npm install -g bower &>> /tmp/deploy.log" container_commands: 01_grunt: command: "export PATH=/usr/local/bin:/bin:/usr/bin; grunt prod &>> […]

在node.js中将http转发到https使用EBS和ELB环境表示应用程序

我正在使用以下将所有http请求redirect到https请求。 我可以从日志中看到,头文件“x-forwarded-proto”永远不会被填充,并且是未定义的。 app.get('*', function(req, res, next) { //http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#x-forwarded-proto if (req.headers['x-forwarded-proto'] != "https") { res.redirect('https://' + req.get('host') + req.url); } else { next(); } }); 这是导致redirect循环。 我如何正确redirect,没有循环?

Node&Elastic Beanstalk:设置环境NODE_ENV = prod

我需要为生产环境执行以下命令: NODE_ENV=production node app.js 我尝试在Configueration下将它作为命令传递: 我在日志中得到以下错误: sh: NODE_ENV=prod node app.js: command not found 我也试过: NODE_ENV=prod // error: sh: NODE_ENV=prod: command not found NODE_ENV=prod app.js // error: sh: NODE_ENV=prod app.js: command not found 在ELB上启动应用程序时,执行以下命令的最佳方式是什么? NODE_ENV=production node app.js

在elasticbeanstalk中设置NODE_ENVvariables

我创build了一个名为.elasticbeanstalk / environment.config的文件,内容如下: option_settings: – option_name: NODE_ENV value: development 我也将process.env.NODE_ENV传递给视图,以便检查值 app.get('/', function(req, res) { var data = { env: process.env.NODE_ENV } res.render('upload',data); }); 在我的本地机器上,我得到了我设置的值“local”。 当我通过$ git aws.push部署到Amazons Elastic Beanstalk时,该值为空。 还有什么我需要做EB认识NODE_ENV设置?

使用弹性beanstalk部署复杂的node.js项目

我想知道什么是使用弹性beanstalk部署复杂node.js而不依赖于外部npm存储库的可用性(以及处理内部开发包的私有pipe理的git存储库的凭证和高可用性)的最佳实践。 它看起来像有一个思想stream派,实际上检查node_modules到实际部署的项目的源代码树。 来源1: http : //www.futurealoof.com/posts/nodemodules-in-git.html 来源2: http : //eng.yammer.com/managing-node-js-dependencies-and-deployments-at-yammer/ 所以听起来像检查他们是正确的方法,但是对于一些编译的软件包存在不同的二进制格式的问题(在Mac上开发和部署到Linux) 我已经尝试过,因为大家build议(检查模块,除了bin文件夹),但即使如此,本地“npm重build”命令失败(它试图chmod bin文件夹中不存在的express.js模块中的东西)我甚至没有去尝试看看beanstalk默认的部署环境如何使用这样一个仓库。 我假设它运行“npm安装”(这将无所作为),但它会运行“npm重build”? 那么,再次,部署具有多个依赖关系的复杂项目的最佳实践是什么? 现在在node / beanstalk世界里,它一定是一个解决的问题,不是吗? 谢谢

什么是处理node.js私有模块依赖关系的推荐方式?

我目前正在使用部署在Elastic Beanstalk上的node.js应用程序。 它已经开始引用github上托pipe的私有模块作为私有存储库。 本地如果我把它的引用到我的package.json的依赖部分,如下所示,它工作正常。 我可以运行nom安装,它下载模块和应用程序没有问题。 "ModuleName": "git+https://TOKEN:x-oauth-basic@github.com/OWNER/REPO_NAME.git" 但是,当我尝试部署到Beanstalk失败,并出现以下错误: 2014-04-04 00:14:09,188 [DEBUG] (1630 MainThread) [commandWrapper.py-60] [root commandWrapper main] Command result: {'status': 'FAILURE', 'results': [{'status': 'FAILURE', 'config_sets': ['Infra-EmbeddedPreBuild', 'Hook-PreAppDeploy', 'Infra-EmbeddedPostBuild'], 'returncode': 1, 'events': [{'msg': 'Failed to run npm install. Snapshot logs for more details.', 'timestamp': 1396570449, 'severity': 'ERROR'}, {'msg': 'Failed to run npm install. npm http GET […]