Coder Social home page Coder Social logo

jank1310 / meteor-launchpad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jshimko/meteor-launchpad

0.0 2.0 0.0 27 KB

A base Docker image for Meteor applications.

Home Page: https://hub.docker.com/r/jshimko/meteor-launchpad/

Shell 100.00%

meteor-launchpad's Introduction

Circle CI

Meteor Launchpad - Base Docker Image for Meteor Apps

Build

Add the following to a Dockerfile in the root of your app:

FROM jshimko/meteor-launchpad:latest

Then you can build the image with:

docker build -t yourname/app .

Run

Now you can run your container with the following command... (note that the app listens on port 3000 because it is run by a non-root user for security reasons and non-root users can't run processes on port 80)

docker run -d \
  -e ROOT_URL=http://example.com \
  -e MONGO_URL=mongodb://url \
  -e MONGO_OPLOG_URL=mongodb://oplog_url \
  -e MAIL_URL=smtp://mail_url.com \
  -p 80:3000 \
  yourname/app

Custom Build Options

Meteor Launchpad supports a few custom build options by using a config file in the root of your app. The currently supported options are to add PhantomJS or MongoDB to your build. To install either of them, create a launchpad.conf in the root of your app and add either of the following values.

# launchpad.conf

INSTALL_PHANTOMJS=true
INSTALL_MONGO=true

If you choose to install Mongo, you can use it by not supplying a MONGO_URL when you run your app container. The startup script will then start Mongo and tell your app to use it. If you do supply a MONGO_URL, Mongo will not be started inside the container and the external database will be used instead.

Note that having Mongo in the same container as your app is just for convenience while testing/developing. In production, you should use a separate Mongo deployment or at least a separate Mongo container.

Development Builds

You can optionally avoid downloading Meteor every time when building regularly in development. Add the following to your Dockerfile instead...

FROM jshimko/meteor-launchpad:devbuild

This isn't recommended for your final production build because it creates a much larger image, but it's a bit of a time saver when you're building often in development. The first build you run will download/install Meteor and then every subsequent build will be able to skip that step and just build the app.

Docker Compose

Add a docker-compose.yml to the root of your project with the following content and edit the app image name to match your build name. Everything else should work as-is.

# docker-compose.yml

app:
  image: yourname/app
  ports:
    - "80:3000"
  links:
    - mongo
  environment:
    - ROOT_URL=http://example.com
    - MONGO_URL=mongodb://mongo:27017/meteor

mongo:
  image: mongo:latest --storageEngine=wiredTiger

And then start the app and database containers with...

docker-compose up -d

meteor-launchpad's People

Contributors

jshimko avatar

Watchers

 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.