Giter VIP home page Giter VIP logo

meteord's Introduction

Circle CI

MeteorD - Docker Runtime for Meteor Apps

There are two main ways you can use Docker with Meteor apps. They are:

  1. Build a Docker image for your app
  2. Running a Meteor bundle with Docker

MeteorD supports these two ways. Let's see how to use MeteorD

1. Build a Docker image for your app

With this method, your app will be converted into a Docker image. Then you can simply run that image.

For that, you can use meteorhacks/meteord as your base image. Magically, that's only you've to do. Here's how to do it.

Add following Dockerfile into the root of your app:

FROM meteorhacks/meteord
MAINTAINER Your Name

Then you can build the docker image with:

docker build -t yourname/app .

Then you can run your meteor image with

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -p 8080:80 \
    yourname/app 

Then you can access your app from the port 8080 of the host system.

2. Running a Meteor bundle with Docker

For this you can directly use the MeteorD to run your meteor bundle. MeteorD can accept your bundle either from a local mount or from the web. Let's see:

2.1 From a Local Mount

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -v /mybundle_dir:/bundle \
    -p 8080:80 \
    meteorhacks/meteord

With this method, MeteorD looks for the tarball version of the meteor bundle. So, you should build the meteor bundle for os.linux.x86_64 and put it inside the /bundle volume. This is how you can build a meteor bundle.

meteor build --architecture=os.linux.x86_64 ./

2.1 From the Web

You can also simply give URL of the tarball with BUNDLE_URL environment variable. Then MeteorD will fetch the bundle and run it. This is how to do it:

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -p 8080:80 \
    meteorhacks/meteord

Rebuilding Binary Modules

Sometimes, you need to rebuild binary npm modules. If so, expose REBULD_NPM_MODULES environment variable. It will take couple of seconds to complete the rebuilding process.

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -e REBULD_NPM_MODULES=1 \
    -p 8080:80 \
    meteorhacks/meteord

meteord's People

Contributors

arunoda avatar jhgaylor avatar pauloborges avatar lgandecki avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.