Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

iSuslov/passenger-meteor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

zuzel/passenger-meteor

Docker image for meteor passenger. Runs meteor in production mode only and does not contain meteor binaries.

Inside:

  • Latest Phusion Passenger (5.0.28 as for 09 May 2016)
  • Node v0.10.44
  • Everything else you need to run meteor (phantomjs not included)
  • CUPS (Common Unix Printing Server)

Needed from you:

  • Unpackaged meteor bundle.
  • Passenger config with meteor enviroment variables. What gives?

Quick start:

  • Unpack meteor bundle to /some_dir on your localhost
  • Create passenger config myapp.conf in /some_other_dir

Example of myapp.conf:

server {
    listen 80;
    server_name yourserver.com;

    # Tell Nginx and Passenger where your app's 'public' directory is
    root /var/www/my_app_name/public;

    # Turn on Passenger
    passenger_enabled on;
    # Tell Passenger that your app is a Meteor app
    passenger_app_type node;
    passenger_startup_file main.js;

    # Meteor needs sticky sessions
    passenger_sticky_sessions on;

    # Tell your app where MongoDB is
    passenger_env_var MONGO_URL mongodb://mongoserver:27017/myappdb;
    # Tell your app what its root URL is
    passenger_env_var ROOT_URL http://yourserver.com;
    
    # Meteor settings json, if exists
    passenger_env_var METEOR_SETTINGS '{"your JSON": "goes here"}';
}

Full passenger+nginx property reference

Important

Notice how root property is defined inside the config file. Passenger needs public folder. You should define this property exactly like this, with the exception that my_app_name folder can have any name. Don't worry, this docker image will create public folder inside unpacked meteor bundle automatically. It will also install all npm dependencies.

Run

To start a container:

docker run -dit \
    --name=my_meteor_passenger \
    -p 80:80 \
    -v /some_dir/bundle:/var/www/my_app_name \
    -v /some_other_dir/myapp.conf:/etc/nginx/sites-enabled/my_app_name.conf \
    zuzel/passenger-meteor

To attach by name:

docker exec -i -t my_meteor_passenger /bin/bash

Troubleshooting

If a container exits immediately after start, double check if you mapped everything (config, bundle dir) correctly. Seriously.