Deploying Meteor via Docker

Hi there, I have just wrote a tutorial on how to deploy docker with a simple Makefile running make deploy each time you wan’t to refresh your running app. I did not use mupx or meteord, because I needed a faster solution, and did not want to store my root password anywhere in my project. What drawbacks do you think my solution has?

Thanks a lot!

1 Like

nice article. Can I generate a docker image after meteor app installation then move image to another server and run meteor app?

Yes, you can also run multiple containers from the same image to balance load, and you can copy the image to another host and instantiate a running container there.
If you would like to copy the builded image without a repository, first create a tar file on your host where you have built the image:

$ docker save -o <save image to path> <image name>

Copy the generated file to the other host, and run the following command on the other host:

$ docker load -i <path to image tar file>

After this you will be able to create a container from the image on the other host, too.

I hope this helps you :smile:

I also use docker for deployments, basing on meteord images. Hoped to see a solution to something that has been bugging me for a while: how do you install a specific Meteor version? RUN curl | /bin/sh gets the newest one, currently But the app I’m building specifies Does this matter as far as bundling the meteor app into node.js app is concerned? Will it suddenly become important when 1.2 gets released and introduces incompatibilities with 1.1.x?

To use a specific version of Meteor, run the following command in the project directory:

meteor update --release <version, e.g.>

I think the difference in Meteor versions will not affect which node.js version you are using until it is >1.10.0
The build however can be affected. The 1.2 version has break for example, check it out here:

Hope I could help a little :smile:

In my workflow the app is bundled as part of building the docker image. And it’s done on the server (using Dokku) - code and a Dockerfile gets pushed to remote, docker image built & ran there. Basically I’m trying to understand whether there can be problems when building a meteor app that specifies for example version with meteor tool newer than that.

Great article.

Is there any specific reason why you didn’t use the official mongodb image that is in docker?

Here’s a super useful single line:
docker save {DOCKER_IMAGE} | bzip2 | pv | ssh {user}@{server} ‘bunzip2 | docker load’

I had the same problem. I’m using this script to install a specific meteor version, let’s say

curl -sL | sed s/RELEASE=\"\.*\"/RELEASE=\"\"/g | /bin/bash

Hope it helps.