A Docker image for Meteor. Intended to work independently but also as a drop-in image for Kadira's Meteor Up (not the meteorhacks
version or "MupX" though!)
Please see the explanation of the tag variations (e.g. -builddeps
, -onbuild
) below.
node-4
,node-4.7.0
node-4-builddeps
,node-4.7.0-builddeps
node-4-onbuild
,node-4.7.0-onbuild
node-4.6.2
node-4.6.2-builddeps
node-4.6.2-onbuild
-
Add a
Dockerfile
to the root of your Meteor app that uses this image:FROM abernix/spaceglue:node-4-onbuild
-
docker build .
-
Run the new image!
You can run it however you would normally run a Docker image. Maybe on a Container service or just using
docker run
– how ever you'd like.Be sure to set any environment variables that Meteor would normally need, like:
MONGO_URL
ROOT_URL
METEOR_SETTINGS
Meteor Up ([website](Meteor Up))
Disclaimer: Currently this won't work. It's waiting for a PR to merge with Kadira
This will only work with the newest mup
which is the one provided in the kadirahq
organization. If your project uses mup.json
, you are using an old version and should update to one that uses the one which uses the mup.js
format.
It will not work with the original meteorhacks
Mup, nor will it work with the MupX branch!
-
Set two
docker
settings in yourmup.js
.image: 'abernix/spaceglue:node-4-onbuild'
imagePort: 3000
If you don't already have a
docker
setting, you need to add it in themeteor
object:module.exports = { servers: { // existing server stuff here. }, meteor: { name: 'app', // your app may vary path: '../app', // This is the section you need to add/modify docker: { image: 'abernix/spaceglue:node-4-builddeps', imagePort: 3000, }, // other settings, which may have already been there! }, // more settings, like mongo...maybe? depends if it was already there! mongo: { // see docs. }, };
-
mup deploy
There are three variations of each major Node-based release.
- "Base" (No tag suffix)
-builddeps
-onbuild
You probably can't use this. This image is suitable if you have NO binary dependencies in your project (honestly, you probably have some) OR if you're running your meteor build
on the same architecture as this image, meaning no recompilation of said binary dependencies will be necessary. This means that you need to be running Debian Jessie 64-bit, but you might get away with others.
This can be used with Meteor Up, but only if the above requirement is met. You probably want the next image though.
This image comes with the build dependencies needed to recompile your binary dependencies. This is necessary when you are running meteor build
on one platform/architecture, but deploying to another.
If you're using Meteor Up this is probably the image you want.
If your intention is to build a Docker image straight out of your repo, then this is the image for you. You can basically create a Dockerfile
with FROM abernix/spaceglue:node-4-onbuild
and run docker build .
and you'll get an image that is ready to deploy.
To set these when using docker run
, pass along a -e NAME=VALUE
argument for the setting you'd like to use.
To set these when using Meteor Up, add an enter to the env
section of the meteor
object in your mup.js
. This will be where you already have your ROOT_URL
, MONGO_URL
, etc.:
env: {
ROOT_URL: 'http://app.com',
// Add it here!
NAME: 'VALUE',
},
This can be used for various settings that will be passed to node
. Some are outlined below, but run: node --v8-options
or node -h
to see all possible options. These might include:
If your app is running in low memory environment, the default garbage collection settings of node can lead to out-of-memory crashes even when there are no leaks.
Setting NODE_OPTIONS
to --max-old-space-size=150
sets the heap limit before garbage-collection begins aggressively freeing up memory to 150 MB instead of 1500 MB (the default).