Sunday, 15 June 2014

nginx - Deploying meteor.js app with docker and phusion-passenger -



nginx - Deploying meteor.js app with docker and phusion-passenger -

i trying deploy meteor.js application ubuntu 14.04 vps. using private docker registry on dockerhub, automated build setup pulling git repository on bitbucket. works well.

however, when run container not able see meteor app running. have read phusion-passenger , meteor in documentation, think guide missing something, cannot work.

my approach has been utilize meteor create application:

meteor create simple-wishes

this creates directory css, html , js file within (and .meteor folder). outside directory have created dockerfile, looking this:

from phusion/passenger-nodejs:0.9.14 maintainer søren pedersen # set right environment variables. env home /root # utilize baseimage-docker's init process. cmd ["/sbin/my_init"] # ssh add together ssh/id_rsa.pub /tmp/your_key run cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key # install meteor run curl https://install.meteor.com | /bin/sh # remove default site run rm /etc/nginx/sites-enabled/default # enable nginx run rm -f /etc/service/nginx/down # setup app add together webapp.conf /etc/nginx/sites-enabled/webapp.conf run mkdir /home/app/simple-wishes add together simple-wishes /home/app/simple-wishes

the webapp.conf file referenced in dockerfile looks this:

server { hear 80; server_name simple-wishes.com; root /home/app/simple-wishes/public; passenger_enabled on; passenger_user app; passenger_sticky_sessions on; passenger_set_cgi_param mongo_url mongodb://localhost:27017/meteor; passenger_set_cgi_param mongo_oplog_url mongodb://localhost:27017/local; passenger_set_cgi_param root_url http://simple-wishes.com; # set these if app meteor bundle! #passenger_app_type node; #passenger_startup_file main.js; }

on vps run container this:

docker run -d -p 80:80 -p 2200:22 sohape/simplewishes

this pulls image dockerhub , starts container daemon mode, mapping port 80 , 22 port 80 , 2200 on host.

when create http request server (http://simple-wishes.com), error nginx:

502 bad gateway

i must missing step here, cannot figure out what. hope can point me in right direction.

thanks lot in advance!

local host within docker container not same localhost outside. may want utilize --link link containers if mongo in own container or utilize well-known dns entry.

nginx meteor passenger docker

No comments:

Post a Comment