Code Monkey home page Code Monkey logo

docker-meteor's Introduction

tozd/meteor

https://gitlab.com/tozd/docker/meteor

Available as:

Description

Image which can serve as a base Docker image for dockerizing Meteor applications.

In the root directory of your Meteor application (the one with .meteor directory) create a Dockerfile file with the following content:

FROM registry.gitlab.com/tozd/docker/meteor:ubuntu-focal-<Meteor version>

For example:

FROM registry.gitlab.com/tozd/docker/meteor:ubuntu-focal-1.10.2

Meteor version should be the version of Meteor you want to use to build your Meteor application. By using a fixed version of Meteor you achieve reproducible builds of your application. You can also specify the Ubuntu LTS version you want to use as the basis of your Docker image. In the example above, this is Ubuntu Focal. See all available tags on Docker Hub.

And your Meteor application is dockerized. To optimize image building, especially if you are building the image from a directory where you are also developing the application, add .dockerignore file with something like:

.meteor/local
packages/*/.build*
node_modules

The intended use of this image is that it is run alongside the tozd/meteor-mongodb image for MongoDB database for your Meteor application. You will probably want a HTTP reverse proxy in front. You can use tozd/docker-nginx-proxy image which provides nginx configured as a reverse proxy with automatic SSL support provided by Let's encrypt.

When running Docker image with your Meteor application, you have to configure the following environment variables:

  • ROOT_URL – used by Meteor to construct absolute URLs, it should not contain a trailing /; example: http://example.com
  • MAIL_URL – used to configure e-mail server; example: smtp://user:password@mailhost:port/
  • METEOR_SETTINGS – JSON string of your Meteor settings
  • MONGO_URL – MongoDB database URL; example: mongodb://mongodb/meteor
  • MONGO_OPLOG_URL – MongoDB database oplog URL; example: mongodb://mongodb/local
  • LOG_TO_STDOUT – if set to 1 log output to stdout instead to /var/log/meteor

You can specify those environment variables when running an image, but you can also export them from the script file volume mounted under /etc/service/meteor/run.config.

Example of a run.config file:

MONGODB_ADMIN_PWD='<pass>'
MONGODB_CREATE_PWD='<pass>'
MONGODB_OPLOGGER_PWD='<pass>'

export MONGO_URL="mongodb://meteor:${MONGODB_CREATE_PWD}@mongodb/meteor"
export MONGO_OPLOG_URL="mongodb://oplogger:${MONGODB_OPLOGGER_PWD}@mongodb/local?authSource=admin"

Only export lines are necessary for this image, but others are used by tozd/meteor-mongodb image. You can export also other environment variables.

When you are extending this image, you can add a script /etc/service/meteor/run.initialization which will be run at a container startup, after the container is initialized, but before the Meteor application is run.

If you have to do anything to the base Docker image, before your Meteor application starts building (e.g., installing an Ubuntu package), add a docker-source.sh file to the root of your Meteor application and it will be run before the build.

All images are rebuild daily to get any latest (security) updates from the underlying distribution. If you do the same in your image (which extends any of these images), you will get those updates as well.

Testing image

For testing Meteor applications, use tozd/meteor-testing Docker image instead.

docker-meteor's People

Contributors

averissimo avatar janat08 avatar kostko avatar metalcamp avatar mitar avatar thoaif avatar

Watchers

 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.