Meteor-tupperware: Lean, production-ready Docker image base for Meteor.js apps


#1

Turn your Meteor.js app into a lean, production-ready Docker image in 2 minutes!

Assuming you have Docker installed and running:

  1. Create Dockerfile and .dockerignore (copy paste from README)
  2. Run docker build -t yourapp .

You can also configure it to bundle in ImageMagick and PhantomJS if your app requires them as dependencies.

See docs here: https://github.com/chriswessels/meteor-tupperware

Improvements coming. Contributions welcome!

Chris


#2

Thank you very much for this. Meteor developers definitely need an easy way to wrap their application in a docker container (or even a complete pod including mongodb). How does meteor-tupperware compares to meteorhacks/meteord?


#3

Thanks @mquandalle. At first I tried meteord, but decided to roll my own solution. These are the primary differences:

simple_app_meteord               latest              c3d9faca5be9        12 hours ago        704.9 MB
simple_app_tupperware            latest              88d9abbb4812        12 hours ago        179.8 MB
  1. meteor-tupperware produces significantly smaller images (179.8mb vs 704.9mb) than meteord: a) meteord bakes in PhantomJS irrespective of whether you need it or not. b) meteord doesn’t perform any significant image cleanup.

  2. meteord doesn’t easily support building Meteor.js apps that have native apps via Meteor Cordova integration because it doesn’t let you customise the build flags (for --mobile-settings or --server). meteor-tupperware let’s you do this easily.

  3. meteor-tupperware allows you to easily include ImageMagick if it is a dependency of your app.

  4. meteor-tupperware is easier to use (in my opinion). Look at the respective docs for usage instructions.


That being said, meteord does some things that meteor-tupperware doesn’t, like:

  1. Running an already-built bundle inside a container from:
    a) a local mount or;
    b) downloadable bundle archive.

These are cool features, but I wanted meteor-tupperware to serve a single purpose well: Turning your Meteor.js app into a production-ready Docker image as easily as possible.

Contributions to meteor-tupperware are welcome!

PS. Bits and pieces of the meteor-tupperware codebase were inspired by meteord, so thanks to arunoda and the meteorhacks team!

Chris


#4

That’s a good comparison.
I’ll learn few things from your image and try to make meteord lean as well :slight_smile:


#5

Thanks @arunoda!

I’d love to work together on an amalgamated solution rather than sharding the community across different solutions. We could have a Hangout/Skype session to discuss if you agree?

PS. Your work on Meteor and the ecosystem of tools is incredible. Thanks!


#6

I’ve tried some of your cleanup concepts and changed a bit how we use scripts and figure out a way to reduce a size a lot.

But, I think your dynamic solution for and initialising Dokerfile from the bash script is a good idea. I don’t want to use if for meteord because primary focus of meteord is to run a bundle. (for Mup)

Yeah! I’d like to chat.


#7

Hi @chriswessels,
I didn’t try it yet but I definitly need to test meteor-tupperware soon, thanks for sharing it, great work!


#8

Okay. I’ve managed to make MeteorD lean as well. We’ll have phantomjs included by default. So, images will be 220MB+

I tested with a some big meteor app telescope and it was ~270MB.

Now, I’ve got couple of images for different tasks as well.
See: https://github.com/meteorhacks/meteord


#9

Hi all.

I am never here on this forum, but I am an OpenShift v3 consultant for Red Hat, and my brother is a meteor developer, so naturally I am interested in hosting meteor apps for him in my OpenShift environment.

For anyone who doesn’t know, OpenShift v3 takes docker container images, allows you to point to an artifact repository like github, and in two clicks have your meteor app up and running. In case there is any confusion, you would know OpenShift v3 as OpenShift Origin in the open source community. This is no longer based on gear technology, but is instead fully docker based.

I’ll be trying this container in my OpenShift environment shortly, but if it doesn’t work as-is, if someone would be willing to work with me to build an OpenShift template, I can work to get it included with OpenShift by default, so that MeteorJS is a first class citizen in OpenShift, just like Java, Ruby, NodeJS, etc.

Please let me know if there is any interest in this, and if so, I’d love to demo the functionality of it once it’s built.

Again, I know MeteorJS in OpenShift (for example OpenShift online) has been figured out, but this is for the next generation docker-based platform, and I’d love to see Meteor on board and functional OOB.

:slight_smile:


#10

I just wanted to write a follow-up comment to say a few things.

One, I didn’t realize that this thread was a year old, haha.

Two, here are a couple of step by step installs for sample applications to give you an idea of how this would work. Please note that I would perform all of these except for the configuration of the initial docker image, and I would just need some basic details, such as what directories need persistent storage, and where meteor expects to find the code to deploy the app.

After the initial template is created, deploying meteor apps would then require clicking on a meteor template, and then pasting your meteor code’s github repository url into a box, and clicking “create”.

Again, sorry for resurrecting this year old thread, but please let me know if there is any interest in this idea, and if so, I’d love to get it set up. I would guess that it will take a day or two if someone who is very familiar with both docker and meteor is available to discuss this.

Thanks!
David