{"id":20365905,"url":"https://github.com/cycoresystems/docker-meteor","last_synced_at":"2025-04-12T04:52:20.106Z","repository":{"id":20244312,"uuid":"23516736","full_name":"CyCoreSystems/docker-meteor","owner":"CyCoreSystems","description":"Dockerfile and script for running Meteor on Docker","archived":false,"fork":false,"pushed_at":"2019-03-10T18:39:08.000Z","size":76,"stargazers_count":120,"open_issues_count":6,"forks_count":73,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T04:52:03.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyCoreSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-31T15:38:51.000Z","updated_at":"2023-01-02T03:05:49.000Z","dependencies_parsed_at":"2022-08-31T12:13:25.928Z","dependency_job_id":null,"html_url":"https://github.com/CyCoreSystems/docker-meteor","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Fdocker-meteor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Fdocker-meteor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Fdocker-meteor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyCoreSystems%2Fdocker-meteor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyCoreSystems","download_url":"https://codeload.github.com/CyCoreSystems/docker-meteor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519473,"owners_count":21117757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T00:21:06.542Z","updated_at":"2025-04-12T04:52:20.082Z","avatar_url":"https://github.com/CyCoreSystems.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Meteor 1.8+\n\nWe are working on a more modern system for this package which will integrate the\nbenefits of the multi-stage builder.  In the mean time, however, I invite you to\ntake a look at our new Dockerfile generator.\n\nWe have developed a multi-stage Dockerfile which provides:\n\n  - much faster container startup\n  - more reliable builds\n  - better CI/CD compatibility\n  - better version support of Node\n\nTo generate a multi-stage Dockerfile for your Meteor app, you can use the\n[meteor-dockerfilegen](https://github.com/CyCoreSystems/go-meteor) tool.  Binary\nreleases of this tool are located [here](https://github.com/CyCoreSystems/go-meteor/releases).\n\nThis tool reads your Meteor application and builds the Dockerfile with\nappropriate versions of Node and Meteor, as specified by your Meteor\napplication's metadata.\n\n## Meteor 1.4+\n\nThe `latest` Docker tag and the `master` git branch are for Meteor 1.4+.  For\nprior versions of Meteor, please use the `legacy` tag and branch.\n\n## Build tag\n\nIn order to keep the size of the image down, the `current` tag does _not_\ninclude `build-essential` tools.  If you are using modules which do not supply\nbinary versions for your platform, please use the `build` tag, which does\ninclude `build-essential`. \n\n**NOTE** `build-essential` is necessary if you use the `bcrypt` module, which is\nused by the `accounts-password` package, so if you are using password-based\nlogins on your site, you must use the `:build` Docker tag (`build` git branch).\n\n## Features:\n\n * Meteor 1.4+ package/bundle support (for previous Meteor versions, use the\n   `legacy` branch/tag)\n * Bundle-based execution\n   * directory referenced as `APP_DIR` (meteor build --directory); defaults to `/home/meteor/www`\n   * compressed directory referenced as `BUNDLE_FILE` (meteor build);\n   * downloaded with `curl` from `BUNDLE_URL` (if supplied)\n   * set `CURL_OPTS` if you need to pass additional parameters\n * Source-based build/execution\n   * Downloads latest Meteor tool at runtime (always the latest tool version unless a `RELEASE` is specified, but apps run with their own versions)\n   * Supply source at `SRC_DIR` (defaults to `/home/meteor/src`)\n   * Supply source from `REPO` (git clone URL)\n      * Optionally specify a `DEPLOY_KEY` file for SSH authentication to private repositories\n      * Optionally specify a `BRANCH` is not the default `master` (can also be a tag name)\n * References your external MongoDB database\n   * Uses Docker links (i.e. `MONGO_PORT`...)\n   * Explicit Mongo URLs by at `MONGO_URL`\n   * NOTE: This does NOT set `MONGO_OPLOG_URL`.  There were too many potential complications.  As a result, unless you explicitly set `MONGO_OPLOG_URL`, Meteor will fall back to a polling-based approach to database synchronization.  Note that oplog tailing requires a working replica set on your MongoDB server as well as access to the `local` database.\n * Optionally specify the port on which the web server should run (`PORT`); defaults to 3000\n * Non-root location of Meteor tree; the script will search for the first .meteor directory\n * _NOTE_: PhantomJS is no longer pre-installed.  This package was swelling the size of the image by 50%, and it is not maintainable with the standard Docker Node images.  Instead, please use one of the docker-friendly (read port-based) spiderable packages on Meteor, such as [ongoworks:spiderable](https://atmospherejs.com/ongoworks/spiderable);  if there is demand, please create an issue on Github, and I'll see about managing a separate branch for it.\n\n## Versions\n\nThe Meteor tool (if required; see Modes of Operation below) is downloaded at\nruntime, so it is no longer packaged and the version of this docker image does\nnot matter for the version of meteor.\n\nYou can specify which version of Meteor you want to be installed by setting the\n`RELEASE` as required.  However, this release of `ulexus/meteor` does require a\nminimum version of 1.4 for your Meteor application.\n\n## Modes of operation\n\nThere are two basic modes of operation for this image: source and pre-bundled.\nThe source method allows the greatest flexibility, since it builds and bundles\nMeteor on the deployment system inside the same container.  However, it also\ntakes much longer and requires a much larger disk footprint.\n\n### Source mode\n\nTo utilize source mode, define one of `SRC_DIR` or `REPO`:\n\n  - `SRC_DIR`\n      If you put your application source in the directory pointed to by `SRC_DIR` (`/home/meteor/src`, by default), this container will download the Meteor tool,\n      build your application, bundle it, then execute it.  It is usually sufficient to simply pass `docker run` an argument like `-v /srv/myApp:/src/app`.\n\n  - `REPO`\n      If you populate the `REPO` environment variable, it is presumed that this is where your application source resides.  This container will\n      `git pull` your `REPO`, change to `master` or the supplied `BRANCH` (which can also be a tag).  The source tree will be placed in\n      `APP_DIR`, and the script will pick up processing `APP_DIR` (above) from there.\n\nWhen the container is run, the appropriate version of the Meteor tool will be\ndownloaded and installed, your application will be built/bundled, and then it\nwill be run.  This process can take several *minutes* to complete.\n\n#### Running without root\n\nAs of Meteor 1.4.2, running Meteor as root has been strongly dissuaded.  As a\nresult, we now drop root privileges after starting the container.  This means\nthat if you are bind-mounting your source or bundle directories, the files must\nbe **readable** and **writable** by the container's unprivileged user (**UID 1000**).\n\n### Pre-bundled mode\n\nTo utilize the pre-bundled mode, **DO NOT** define `SRC_DIR` or `REPO`.  Instead\ndefine one of `APP_DIR` or `BUNDLE_DIR`:\n\n  - `APP_DIR`\n      If you put your bundled application in the directory pointed to by `APP_DIR` (`/home/meteor/www`, by default), this container will attempt to find a Meteor bundle\n      in this directory and then start Node to run that bundle.  The Meteor tool will not be installed (as a bundled Meteor app needs only Node).\n      The default `APP_DIR` is `/home/meteor/www`, so you may attach that as a volume, for greatest simplicity.  Something like: `-v /srv/myApp:/home/meteor/www`.\n  - `BUNDLE_FILE`\n      If you put your compressed (*.tar.gz) application in the directory pointed to by `BUNDLE_FILE`, this container will attempt to find a compressed Meteor bundle\n      in this directory, decompress the file, and then start Node to run that bundle.  The Meteor tool will not be installed (as a bundled Meteor app needs only Node).\n      You may attach that as a volume, for greatest simplicity.  Something like: `-e BUNDLE_FILE='home/meteor/build.tar.gz -v /srv/build.tar.gz:/home/meteor/build.tar.gz`.\n  - `BUNDLE_URL`\n      If you populate `BUNDLE_URL`, the container expects to find a bundled tarball, as generated by `meteor build ./` at this URL.  The tarball is\n      downloaded (with curl... so you may set `CURL_OPTS` as required) and extracted to the bundle directory, and the process continues from `BUNDLE_DIR` (above).\n\nWhen the container is run, the Meteor tool will NOT be downloaded.  Instead,\n`npm install` will be run to resolve any dependencies for the server, and your\napplication will be run directly with NodeJS.\n\n## Examples:\n\n### git repo with non-default (master) branch\n```sh\ndocker run --rm \\\n  -e ROOT_URL=http://testsite.com \\\n  -e REPO=https://github.com/yourName/testsite \\\n  -e BRANCH=testing \\\n  -e MONGO_URL=mongodb://mymongoserver.com:27017/mydatabase \\\n  -e MONGO_OPLOG_URL=mongodb://mymongoserver.com:27017/local \\\n  ulexus/meteor\n```\n\n### app source from a local directory on host (/home/user/myapp)\n```sh\ndocker run --rm \\\n  -e ROOT_URL=http://testsite.com \\\n  -v /home/user/myapp:/home/meteor/src \\\n  -e MONGO_URL=mongodb://mymongoserver.com:27017/appdb \\\n  -e MONGO_OPLOG_URL=mongodb://mymongoserver.com:27017/local \\\n  ulexus/meteor\n```\n\n### pre-bundled app from a local directory on host (/home/user/myapp)\n```sh\ndocker run --rm \\\n  -e ROOT_URL=http://testsite.com \\\n  -v /home/user/myapp:/home/meteor/www \\\n  -e MONGO_URL=mongodb://mymongoserver.com:27017/appdb \\\n  -e MONGO_OPLOG_URL=mongodb://mymongoserver.com:27017/local \\\n  ulexus/meteor\n```\n\n### pre-bundled and compressed app from a local directory on host (/home/user/build.tar.gz)\n```sh\ndocker run --rm \\\n  -e ROOT_URL=http://testsite.com \\\n  -e BUNDLE_FILE=/home/meteor/build.tar.gz \\\n  -v /home/user/build.tar.gz:/home/meteor/build.tar.gz \\\n  -e MONGO_URL=mongodb://mymongoserver.com:27017/appdb \\\n  -e MONGO_OPLOG_URL=mongodb://mymongoserver.com:27017/local \\\n  ulexus/meteor\n```\n\n### local app source directory on host (/home/user/myapp) with specific Meteor release (1.4.2.1)\n```sh\ndocker run --rm \\\n  -e ROOT_URL=http://testsite.com \\\n  -v /home/user/myapp:/home/meteor/src \\\n  -e MONGO_URL=mongodb://mymongoserver.com:27017/appdb \\\n  -e MONGO_OPLOG_URL=mongodb://mymongoserver.com:27017/local \\\n  -e RELEASE=1.4.2.1 \\\n  ulexus/meteor\n```\n\n### Unit file\n\nThere is also a sample systemd [unit file](meteor.myapp@.service) in the Github repository.\n\n### Build with bundled app\n\nPre-bundling your Meteor application will make it start *much* faster and will\nallow the container to maintain a smaller storage footprint.  However, it does\nrequire that you build for the same architecture on which you will be deploying.\n\n```bash\ncd $app_source\nmeteor build --directory /tmp/export-meteor/build\ncat \u003e/tmp/export-meteor/Dockerfile \u003c\u003cENDHERE\nFROM ulexus/meteor\nCOPY build /home/meteor/www\nRUN chown -R meteor:meteor /home/meteor/\nENDHERE\ncd /tmp/export-meteor\ndocker build -t myapp .\ndocker push myapp\n```\n\n### Kubernetes\n\nThere is a complete example with build script of building and running a\nversioned container in kubernetes in the\n[examples](https://github.com/CyCoreSystems/docker-meteor/tree/master/examples)\ndirectory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycoresystems%2Fdocker-meteor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycoresystems%2Fdocker-meteor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycoresystems%2Fdocker-meteor/lists"}