Add the following to a Dockerfile
in the root of your app:
FROM gcr.io/nioinstances/meteor-base:latest
Then you can build the image with:
docker build -t yourname/app .
Setting up a .dockerignore file
There are several parts of a Meteor development environment that you don't need to pass into a Docker build because a complete production build happens inside the container. For example, you don't need to pass in your node_modules
or the local build files and development database that live in .meteor/local
. To avoid copying all of these into the container, here's a recommended starting point for a .dockerignore
file to be put into the root of your app. Read more: https://docs.docker.com/engine/reference/builder/#dockerignore-file
.git
.meteor/local
node_modules
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
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.