Git Product home page Git Product logo

meteord's Introduction

Circle CI

MeteorD - Docker image for MUP

Supported tags

Please see the explanation of the tag variations (e.g. -binbuild, -onbuild) below.

Node 12 (Meteor 1.9+)

Node 12.20.0

  • node-12-base, node-12.20.0-base
  • node-12-binbuild, node-12.20.0-binbuild
  • node-12-onbuild, node-12.20.0-onbuild
  • node-12-devbuild, node-12.20.0-devbuild

Node 8 (Meteor 1.6, 1.7, 1.8)

Node 8.16.1

  • node-8-base, node-8.16.1-base
  • node-8-binbuild, node-8.16.1-binbuild
  • node-8-onbuild, node-8.16.1-onbuild
  • node-8-devbuild, node-8.16.1-devbuild

Older Node versions

For brevity, not all possibilities are listed above and there are many more available. It's recommended that you use the latest version within the series which your Meteor was designed for (see titles above). The most recent version will be tagged with a node-x-* tag accordingly. For the full list, please see the "Tags" tab above.

Tag Variations

There are three variations of each major Node-based release.

  • -base
  • -binbuild
  • -onbuild
  • -devbuild

There are two main ways you can use Docker with Meteor apps. They are:

  1. Build a Docker image for your app
  2. Running a Meteor bundle with Docker

MeteorD supports these two ways. Let's see how to use MeteorD

1. Build a Docker image for your app

With this method, your app will be converted into a Docker image. Then you can simply run that image.

For that, you can use abernix/meteord:onbuild as your base image. Magically, that's only thing you have to do. Here's how to do it:

Add following Dockerfile into the root of your app:

FROM abernix/meteord:onbuild

Then you can build the docker image with:

docker build -t yourname/app .

Then you can run your meteor image with

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -p 8080:80 \
    yourname/app

Then you can access your app from the port 8080 of the host system.

Stop downloading Meteor each and every time (mostly in development)

So, with the above method, MeteorD will download and install Meteor each and every time. That's bad especially in development. So, we've a solution for that. Simply use aberaber/meteord:devbuild as your base image.

WARNING: Don't use abernix/meteord:devbuild for your final build. If you used it, your image will carry the Meteor distribution as well. As a result of that, you'll end up with an image with ~700 MB.

2. Running a Meteor bundle with Docker

For this you can directly use the MeteorD to run your meteor bundle. MeteorD can accept your bundle either from a local mount or from the web. Let's see:

2.1 From a Local Mount

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -v /mybundle_dir:/bundle \
    -p 8080:80 \
    abernix/meteord:base

With this method, MeteorD looks for the tarball version of the meteor bundle. So, you should build the meteor bundle for os.linux.x86_64 and put it inside the /bundle volume. This is how you can build a meteor bundle.

meteor build --architecture=os.linux.x86_64 ./

2.1 From the Web

You can also simply give URL of the tarball with BUNDLE_URL environment variable. Then MeteorD will fetch the bundle and run it. This is how to do it:

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -p 8080:80 \
    abernix/meteord:base

2.2 With Docker Compose

docker-compose.yml

dashboard:
  image: yourrepo/yourapp
  ports:
   - "80:80"
  links:
   - mongo
  environment:
   - MONGO_URL=mongodb://mongo/yourapp
   - ROOT_URL=http://yourapp.com
   - MAIL_URL=smtp://some.mailserver.com:25

mongo:
  image: mongo:latest

When using Docker Compose to start a Meteor container with a Mongo container as well, we need to wait for the database to start up before we try to start the Meteor app, else the container will fail to start.

This sample docker-compose.yml file starts up a container that has used abernix/meterod as its base and a mongo container. It also passes along several variables to Meteor needed to start up, specifies the port number the container will listen on, and waits 30 seconds for the mongodb container to start up before starting up the Meteor container.

Rebuilding Binary Modules

Sometimes, you need to rebuild binary npm modules. If so, expose REBUILD_NPM_MODULES environment variable. It will take couple of seconds to complete the rebuilding process.

docker run -d \
    -e ROOT_URL=http://yourapp.com \
    -e MONGO_URL=mongodb://url \
    -e MONGO_OPLOG_URL=mongodb://oplog_url \
    -e BUNDLE_URL=http://mybundle_url_at_s3.tar.gz \
    -e REBUILD_NPM_MODULES=1 \
    -p 8080:80 \
    abernix/meteord:binbuild

meteord's People

Contributors

abernix avatar andrew-wharton avatar arunoda avatar borgand avatar danrubins avatar jakobrosenberg avatar jdivy avatar jeffhmngi avatar jhgaylor avatar lgandecki avatar madushan1000 avatar mhhf avatar mpowaga avatar ndarilek avatar neufeldtech avatar pauloborges avatar supermock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteord's Issues

Dependency issue - Removal of Wheezy and Jessie from mirrors

I am facing the following issue

W: Failed to fetch
http://ftp.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages
404  Not Found

W: Failed to fetch
http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
 404  Not Found

Quoting this link

as Wheezy and Jessie have been integrated into the archive.debian.org
structure recently, we are now removing all of Wheezy and all non-LTS
architectures of Jessie from the mirror network starting today.
That is, only Jessie i386, amd64, armel and armhf will continue to be
hosted on the normal mirrors.

The data is, of course, not lost - the whole of it is synced
to archive.debian.org, so if you still need it you will be able to get
it from there.[1]

gyp WARN EACCES user "undefined" does not have permission to access the dev dir

When I build the project with gitlab-ci get stuck in infinity loop:

  • Gitlab-CI
image: docker:latest

variables:
  REGISTRO: "XXXXXXX"
  NAMESPACE: "XXXXXX"
  DOCKER_DRIVER: overlay
  GIT_SUBMODULE_STRATEGY: recursive

services:
  - docker:dind

stages:
  - build

before_script:
  - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $REGISTRO

build_master:
  stage: build
  script:
    - docker pull $REGISTRO/$NAMESPACE/$CI_PROJECT_NAME:latest || true
    - docker build --cache-from $REGISTRO/$NAMESPACE/$CI_PROJECT_NAME:latest -t $REGISTRO/$NAMESPACE/$CI_PROJECT_NAME:stable .
    - docker push $REGISTRO/$NAMESPACE/$CI_PROJECT_NAME:stable
  only:
    - master
  • Dockerfile:
FROM abernix/meteord:node-8-devbuild
  • Log giltab-runner:
�[91mautoprefixer: /copied-app/packages/gadicohen_prism/lib/prism/plugins/line-highlight/prism-line-highlight.css:17:1: Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.
�[0m�[91m+ echo '=> Printing Meteor Node information...'
�[0m�[91m+ echo '  => platform'
+ meteor node -p process.platform
�[0m=> Printing Meteor Node information...
  => platform
linux
�[91m+ echo '  => arch'
+ meteor node -p process.arch
�[0m  => arch
x64
�[91m+ echo '  => versions'
+ meteor node -p process.versions
�[0m  => versions
{ http_parser: '2.7.0',
  node: '4.8.0',
  v8: '4.5.103.45',
  uv: '1.9.1',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '46',
  openssl: '1.0.2k' }
�[91m+ echo '=> Printing System Node information...'
+ echo '  => platform'
+ node -p process.platform
�[0m=> Printing System Node information...
  => platform
linux
�[91m+ echo '  => arch'
+ node -p process.arch
�[0m  => arch
x64
  => versions
�[91m+ echo '  => versions'
+ node -p process.versions
�[0m{ http_parser: '2.7.0',
  node: '8.9.3',
  v8: '6.1.534.48',
  uv: '1.15.0',
  zlib: '1.2.11',
  ares: '1.10.1-DEV',
  modules: '57',
  nghttp2: '1.25.0',
  openssl: '1.0.2n',
  icu: '59.1',
  unicode: '9.0',
  cldr: '31.0.1',
  tz: '2017b' }
�[91m+ echo '=> Executing NPM install within Bundle'
+ cd /tmp/bundle-dir/bundle/programs/server/
�[0m�[91m+ npm i
�[0m=> Executing NPM install within Bundle
�[91mnpm�[0m�[91m WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
�[0m
> [email protected] install /tmp/bundle-dir/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

�[91mgyp WARN�[0m�[91m EACCES user "undefined" does not have permission to access the dev dir "/root/.node-gyp/8.9.3"
gyp�[0m�[91m WARN EACCES attempting to reinstall using temporary dev dir "/tmp/bundle-dir/bundle/programs/server/node_modules/fibers/.node-gyp"
�[0m�[91mgyp WARN EACCES user "undefined" does not have permission to access the dev dir "/tmp/bundle-dir/bundle/programs/server/node_modules/fibers/.node-gyp/8.9.3"
gyp WARN �[0m�[91mEACCES attempting to reinstall using temporary dev dir "/tmp/bundle-dir/bundle/programs/server/node_modules/fibers/.node-gyp"
...

If I perform the compilation on a computer without dind it works without problems.

I dont know if this could be a solution -> How to use --unsafe-perm in dind?

bundle on docker-compose

what happend to the volume when using docker-compose???
docker-compose.yml

dashboard:
  image: yourrepo/yourapp
  ports:
   - "80:80"
  links:
   - mongo
  environment:
   - MONGO_URL=mongodb://mongo/yourapp
   - ROOT_URL=http://yourapp.com
   - MAIL_URL=smtp://some.mailserver.com:25

mongo:
  image: mongo:latest

xhr polling with abernix/meteord:onbuild

When I use abernix/meteord:onbuild to deploy. The meteor uses xhr polling instead of ddp and it's very slow. Is there a reason for this? App functions normally when deployed with mup and abernix/meteord:base.

screen shot 2018-06-29 at 10 58 25 am

AWS Security Network

Could you add a new settings on docker image?

The problem is when try to settings a security group on AWS with filter by another security group or internal IP (Docker start with 172.17.0.1).

So you cant reach that network, and error "502 Bad gateway" appears, so i think we can add a new field on docker settings like:

docker{
 image:'',
 imageport: ,
 bridgeLan: ''
}

So bridgeLan set --bip: IP on docker run.

Hope you can understand my bad english.

Thanks.

Node 14.17.1 support for new Meteor version 2.3

for people who use new Meteor version 2.3 and need a workaround : you can use temporally https://hub.docker.com/repository/docker/liitfr/meteord which is fork of abernix/meteord supporting node 14

in your MUP settings :

...
    docker: {
      image: 'liitfr/meteord:node-14-base',
    },
...

Related PR : #59

Get security fixes in regularly

To get all Debian security fixes in more frequently an automated build could be set up in Docker Hub listening on upstream repository changes via Repository links.
https://docs.docker.com/docker-hub/builds/#repository-links

If corresponding Debian image changes the meteord image could be rebuilt and re-published under the same tag.

Currently the Debian base image has several critical security issues that have fixes available.

Is there a way to not install phantomjs on the image?

With the recent updates to the image, my installs are taking a lot longer. I think I tracked it down to the install of PhantomJs, it even cause my small 500mb machine to run out of memory and I had to create a swap file to get the install to even finish. here is some code from mupx reconfig in installed Phantom again:

Considering` PhantomJS found at /usr/local/bin/phantomjs
Found PhantomJS at /usr/local/bin/phantomjs ...verifying
PhantomJS detected, but wrong version 1.9.8 @ /usr/local/bin/phantomjs.
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.

Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Receiving...

Everything worked fine 3 days ago.

patch for segmentation faults?

Does the latest 4.8.4 include the patch you did for segfaults?
Because i seem to get segfaults on production via docker but recently i tried running the code with
"meteor(1.5.2.2) node main.js" and it seems to have stopped the segfaults

ECONNREFUSED error

I'm getting an ECONNREFUSED error in my meteor app so I tried going back to a built in example

$ git clone https://github.com/meteor/todos tst
$ cd tst
$ meteor npm install
$ meteor update
$ meteor update --all-packages
$ meteor npm install --save bcrypt
$ meteor

This works, so far so good. Okay, make a docker-compose.yml that uses this repo and a 3.2 version of mongodb (matches what meteor mongo claims is the version used by 1.6).

meteor:
  container_name: tst_meteor_1
  image: abernix/meteord:node-8-devbuild
  ports:
   - "3000:80"
  links:
   - mongo
  volumes:
   - ../output:/bundle
  environment:
   - ROOT_URL=http://localhost:3000
   - METEOR_ALLOW_SUPERUSER=true
   - MONGO_URL=mongodb://localhost:27017/meteor

mongo:
  container_name: tst_mongo_1
  image: mongo:3.2-jessie
  ports:
   - "127.0.0.1:27017:27017"

Now build the app and run it in docker

$ meteor build  ../output --architecture=os.linux.x86_64 --server-only
$ docker-compose --file docker-compose.yml up -d

Check that mongo is runnning

$ docker logs -f tst_mongo_1
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=012d211f6526
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] db version v3.2.17
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] git version: 186656d79574f7dfe0831a7e7821292ab380f667
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] modules: none
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] build environment:
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-11-26T04:48:28.340+0000 I CONTROL  [initandlisten] options: {}
2017-11-26T04:48:28.343+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-11-26T04:48:28.380+0000 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2017-11-26T04:48:28.380+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-11-26T04:48:28.381+0000 I NETWORK  [initandlisten] waiting for connections on port 27017

Yes, check that meteor is running

$ docker logs -f tst_meteor_1

> [email protected] install /bundle/bundle/programs/server
> node npm-rebuild.js


> [email protected] install /bundle/bundle/programs/server/npm/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/bundle/bundle/programs/server/npm/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote

> [email protected] install /bundle/bundle/programs/server/npm/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-57` exists; testing
Binary is fine; exiting
[email protected] /bundle/bundle/programs/server/npm/node_modules/abbrev
... 202 lines of node_modules
[email protected] /bundle/bundle/programs/server/npm/node_modules/meteor-node-stubs/node_modules/indexof
{
  "meteor-dev-bundle": "0.0.0",
  "npm": "5.5.1",
  "ares": "1.10.1-DEV",
  "cldr": "31.0.1",
  "http_parser": "2.7.0",
  "icu": "59.1",
  "modules": "57",
  "nghttp2": "1.25.0",
  "node": "8.9.1",
  "openssl": "1.0.2m",
  "tz": "2017b",
  "unicode": "9.0",
  "uv": "1.15.0",
  "v8": "6.1.534.47",
  "zlib": "1.2.11"
}
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

up to date in 9.48s
=> Starting meteor app on port:80

/bundle/bundle/programs/server/node_modules/fibers/future.js:313
						throw(ex);
						^
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
    at Pool.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:336:35)
    at emitOne (events.js:116:13)
    at Pool.emit (events.js:211:7)
    at Connection.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:280:12)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at Connection.emit (events.js:214:7)
    at Socket.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:187:49)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)

And I get the ECONNREFUSED error

I'm only guessing this is a docker configuration issue. I was running docker-machine in the past but recently upgrading to docker mac and have been working through things that needed to change in my setup. That led to trying something more "official"

Any idea how to fix this issue?

Some other things I tried,

  • moving ports
  • not mapping the internal docker port to the same host port
  • not using a database name (my old configuration didn't need one)

Error when building with OnBuild image

Missing some module:

Errors prevented bundling:
While minifying app stylesheet:
module.js:536:15: Cannot find module 'autoprefixer'
at Function.Module._resolveFilename (module.js:536:15)
at Function.resolve (internal/module.js:18:19)
at Object.require (/tools/isobuild/bundler.js:1873:34)
at packages/minifier-postcss/plugin/minify-css.js:52:37
at Array.forEach (<anonymous>)
at getPostCSSPlugins (packages/minifier-postcss/plugin/minify-css.js:51:43)
at packages/minifier-postcss/plugin/minify-css.js:155:36
at Array.map (<anonymous>)
at mergeCss (packages/minifier-postcss/plugin/minify-css.js:139:23)
at CssToolsMinifier.processFilesForBundle
(packages/minifier-postcss/plugin/minify-css.js:109:18)

Not sure how I could run npm install before the base image start building the project.

mup deploy failed when sharp is installed.

I have a simple meteor app and
have sharp installed by
meteor npm install sharp
it works fine on local run.

when I try to deploy by running mup deploy. it fails.
meteor : Meteor 1.10.2
mup docker : abernix/meteord:node-12.16.1-base

is there anyway I can get this to work?

the mup deloy logs are:

x Prepare Bundle: FAILED

          ------------------------------------STDERR------------------------------------
          The command '/bin/sh -c cd /built_app/programs/server &&     npm install --unsafe-perm' returned a non-zero code: 1
    
    real    1m58.989s
    user    0m2.560s
    sys     0m2.776s
    
          ------------------------------------STDOUT------------------------------------
          so: No such file or directory
    g++: error: ../vendor/lib/libharfbuzz.so: No such file or directory
    g++: error: ../vendor/lib/libjpeg.so: No such file or directory
    g++: error: ../vendor/lib/liblcms2.so: No such file or directory
    g++: error: ../vendor/lib/liborc-0.4.so: No such file or directory
    g++: error: ../vendor/lib/libpango-1.0.so: No such file or directory
    g++: error: ../vendor/lib/libpangocairo-1.0.so: No such file or directory
    g++: error: ../vendor/lib/libpangoft2-1.0.so: No such file or directory
    g++: error: ../vendor/lib/libpixman-1.so: No such file or directory
    g++: error: ../vendor/lib/libpng.so: No such file or directory
    g++: error: ../vendor/lib/librsvg-2.so: No such file or directory
    g++: error: ../vendor/lib/libtiff.so: No such file or directory
    g++: error: ../vendor/lib/libwebp.so: No such file or directory
    g++: error: ../vendor/lib/libwebpdemux.so: No such file or directory
    g++: error: ../vendor/lib/libwebpmux.so: No such file or directory
    g++: error: ../vendor/lib/libxml2.so: No such file or directory
    g++: error: ../vendor/lib/libz.so: No such file or directory
    sharp.target.mk:201: recipe for target 'Release/obj.target/sharp.node' failed
    make: *** [Release/obj.target/sharp.node] Error 1
    make: Leaving directory '/built_app/programs/server/npm/node_modules/sharp/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    gyp ERR! System Linux 4.4.0-1107-aws
    gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /built_app/programs/server/npm/node_modules/sharp
    gyp ERR! node -v v12.16.1
    gyp ERR! node-gyp -v v5.0.7
    gyp ERR! not ok 
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2020-08-13T08_47_18_935Z-debug.log
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! meteor-dev-bundle@ install: `node npm-rebuild.js`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the meteor-dev-bundle@ install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2020-08-13T08_47_18_993Z-debug.log
    
          ------------------------------------------------------------------------------

Node version issue using MUP

Hello)

I am using your abernix/meteord:base Docker image in MUP.
I can see in the Dockerfile here that the node version is 4.8.4, but every time I deploy the node version is 4.8.3 for some reason. I connect to my server and go into the docker instance and run node --version and I get 4.8.3.

Any thoughts on what am I doing wrong?

mup config file
docker: { image: 'abernix/meteord:base', }

Thanks a lot, any help is appreciated :D Lovely day to you <3

Upgrading Node and npm?

Hi, I'm getting an error in deploying the app (using MUP) with a Meteor version 1.5. Would you upgrade the docker image soon?

You are attempting to run Meteor as the "root" user

You are attempting to run Meteor as the "root" user. If you are developing,
this is almost certainly not what you want to do and will likely result in
incorrect file permissions. However, if you are running this in a build process
(CI, etc.) or you are absolutely sure you know what you are doing, add the
--unsafe-perm flag to this command to proceed.

Kindly add the USER to dockerfile.

Thanks

Node inside node-12-base container has wrong timezone

I am in the CET timezone, which means that new Date().getTimezoneOffset() should return -60 at the moment. However it returns 0. As a result, all timestamps saved as UTC in my meteor app are wrong.

Is there some breaking change I have missed? Is there a way to configure the timezone for node or meteor inside the node-12-base docker container?

~$ date
Thu Feb 20 16:10:00 CET 2020
~$ docker exec -it meteor bash
root@ meteor:/# date
Thu Feb 20 16:10:09 CET 2020
root@ meteor:/# node
Welcome to Node.js v12.14.0.
Type ".help" for more information.
> t = new Date()
2020-02-20T15:10:23.155Z
> t.getTimezoneOffset()
0

Bcrypt issue

Hey, I'm having the issue described in this issue: zodern/meteor-up#267

Basically, problems with bcrypt. I'm using Meteor 1.4.2, I think, I'll double-check tomorrow. Just wanted to see if you knew how to deal with this.

Can't find npm module 'common-tags'. Did you forget to call 'Npm.depends' in package.js

I get this same error when I use node-8.4.0-base in MUP or -onbuild following the README.

I tried the spaceglue version of 8.4.0-onbuild, but no success their either

Thanks for any help...

FROM abernix/meteord:node-8.4.0-onbuild
Error: Can't find npm module 'common-tags'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
    at Object.require (/built_app/programs/server/boot.js:266:17)
    at makeInstallerOptions.fallback (packages/modules-runtime.js:641:18)
    at require (packages/modules-runtime.js:234:16)
    at index.js (packages/modules.js:396:19)
    at fileEvaluate (packages/modules-runtime.js:333:9)
    at require (packages/modules-runtime.js:228:16)
    at package-scripts.js (package-scripts.js:1:32)
    at fileEvaluate (packages/modules-runtime.js:333:9)
    at require (packages/modules-runtime.js:228:16)
    at /built_app/programs/server/app/app.js:432:1

Image size

Thanks @abernix for this project, is really great!! I wonder if there is any way of making image size smaller. My project is almost a one-page-app and its size is 1,35GB!!

Failing to build dependency (fibers) on startup causes the container to crash

Hi,

I'm trying for the first time to use this image.
My app is using meteor 1.10.2 (node 12.16.1). I build it for os.linux.x86_64 and it always fails with error messages about failure to build fibers:

/root/.cache/node-gyp/12.16.1/include/node/v8.h:10424:6: note: declared here
 void ReturnValue<T>::Set(const Persistent<S>& handle) {
      ^~~~~~~~~~~~~~
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
fibers.target.mk:120: recipe for target 'Release/obj.target/fibers/src/fibers.o' failed
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /bundle/bundle/programs/server/npm/node_modules/fibers
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: 1: nodejs: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-13T21_00_21_483Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor-dev-bundle@ install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@ install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-13T21_00_21_515Z-debug.log

I initially tried using meteorup on an ubuntu 18.04 ec2 instance on aws, and it failed. I found some discussions mentioning ubuntu 16.04 would be more compatible, so I tried it, but same error.

Since it could be related to the aws environment and/or what meteor does during deploying, I decided to try it locally on my machine (macOS), directly with the abernix/meteord:node-12-base image.

But unfortunately I get exactly the same error. I conclude the problem is then in the image itself.
Anyone having the same problem?

[Help] How to specify node version

When using this image with mup, I am trying to specify node version 4.6.2, using

docker: {
			image: 'abernix/meteord:base', //optional
			args: ['-v /etc/timezone:/etc/timezone', '-v /etc/localtime:/etc/localtime', '--build-arg NODE_VERSION=4.6.2']
		},

It fails with the error : unknown flag: --build-arg

What is the proper procedure?

EDIT: Why 4.6.2? Because Node 4.7+ is causing distinct memory and cpu overuse.

bcrypt/node issue

Hey @abernix ,

Thanks for all your work with the Docker image.

I'm currently having some issues when deploying using your image and Meteor Up.

mup logs returns the following output:

[XXX.XXX.XXX.XXX] npm ERR! Failed at the [email protected] install script.
[XXX.XXX.XXX.XXX] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX] npm ERR! A complete log of this run can be found in:
[XXX.XXX.XXX.XXX] npm ERR!     /root/.npm/_logs/2017-11-09T11_20_55_125Z-debug.log
[XXX.XXX.XXX.XXX] npm WARN [email protected] No description
[XXX.XXX.XXX.XXX] npm WARN [email protected] No repository field.
[XXX.XXX.XXX.XXX] npm WARN [email protected] No license field.
[XXX.XXX.XXX.XXX] npm ERR! code ELIFECYCLE
[XXX.XXX.XXX.XXX] npm ERR! errno 1
[XXX.XXX.XXX.XXX] npm ERR! [email protected] install: `node npm-rebuild.js`
[XXX.XXX.XXX.XXX] npm ERR! Exit status 1
[XXX.XXX.XXX.XXX] npm ERR!
[XXX.XXX.XXX.XXX] npm ERR! Failed at the [email protected] install script.
[XXX.XXX.XXX.XXX] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX] npm ERR! A complete log of this run can be found in:
[XXX.XXX.XXX.XXX] npm ERR!     /root/.npm/_logs/2017-11-09T11_20_55_153Z-debug.log
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX]> [email protected] install /bundle/bundle/programs/server
[XXX.XXX.XXX.XXX]> node npm-rebuild.js
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX]> [email protected] install /bundle/bundle/programs/server/npm/node_modules/bcrypt
[XXX.XXX.XXX.XXX]> node-pre-gyp install --fallback-to-build
[XXX.XXX.XXX.XXX]
[XXX.XXX.XXX.XXX] sh: 1: node-pre-gyp: not found
[XXX.XXX.XXX.XXX] npm ERR! file sh
[XXX.XXX.XXX.XXX] npm ERR! code ELIFECYCLE
[XXX.XXX.XXX.XXX] npm ERR! errno ENOENT
[XXX.XXX.XXX.XXX] npm ERR! syscall spawn
[XXX.XXX.XXX.XXX] npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
[XXX.XXX.XXX.XXX] npm ERR! spawn ENOENT
[XXX.XXX.XXX.XXX] npm ERR!
[XXX.XXX.XXX.XXX] npm ERR! Failed at the [email protected] install script.
[XXX.XXX.XXX.XXX] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[XXX.XXX.XXX.XXX]

Any idea how do fix this?

Thanks

Specify node-args for (build) process

I'm getting the error below on while building the container. Would be helpfull if we could specify node-args to the build process, and perhaps the running node process as well.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

--node-args="--max-old-space-size=6144" is expected to fix this error.

Server-only on build ?

Hello !

I use your base image for my deployments, and for my last project, the build crash everytime...

After search, Cordova is in cause : the server try to build the application for iOS !

I have added --server-only argument on meteor build, and is work well.
Is possible to add this on official image ?

(No pull request, why I use a dirty patch using sed)

Thank you so much for your great job !

Out of memory

Hi, trying to build with, any ideas pls?

Using FROM abernix/meteord:node-4.8.4-onbuild

 docker build --build-arg TOOL_NODE_FLAGS="--max-old-space-size=2048"  -t buzzybuzz/buzzy-main .
Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local


<--- Last few GCs --->

  499469 ms: Scavenge 1390.6 (1455.1) -> 1390.6 (1455.1) MB, 9.1 / 0 ms (+ 3.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
  500804 ms: Mark-sweep 1390.6 (1455.1) -> 1384.8 (1455.1) MB, 1334.6 / 0 ms (+ 4.4 ms in 2 steps since start of marking, biggest step 3.0 ms) [last resort gc].
  502122 ms: Mark-sweep 1384.8 (1455.1) -> 1390.6 (1455.1) MB, 1318.4 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x20ec6d637399 <JS Object>
    1: addMapping(aka SourceMapGenerator_addMapping) [/root/.meteor/packages/meteor-tool/.1.5.2_2.p3bfqz.djlxk++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/source-map/lib/source-map-generator.js:~94] [pc=0x4a15ac40098] (this=0x2734ea06be69 <a SourceMapGenerator with map 0x2feb4686ddf9>,aArgs=0x194be7e4ae31 <an Object with map 0x2feb4686df01>)
    2: /*...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
/opt/meteord/lib/build_app.sh: line 21:   378 Aborted                 meteor build --allow-superuser --directory $BUNDLE_DIR --server=http://localhost:3000
The command '/bin/sh -c bash $METEORD_DIR/lib/build_app.sh' returned a non-zero code: 134

Support for Meteor 1.6?

I know Meteor 1.6 is currently in Beta, but it would be great if you can release an image tag for nodejs 8.3.0 so that we can deploy Meteor 1.6 project to the server.

Deployment failing on new instance

I'm failing to deploy to a new instance. The error I'm getting is:

=> Starting meteor app on port:80
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.


/bundle/bundle/programs/server/node_modules/fibers/future.js:313
                        throw(ex);
                        ^
[object Object]

Which is quite uninformative.
This happens both on Meteor 1.4.1.1 and 1.4.1.2. I made sure I'm using matching versions of node (4.4.7 and 4.6.1) and the images base and base-node-4.6.1.

I can deploy successfully with the same configuration to existing servers.

I've tried to build the container myself because I'd like to modify the fibers package to log more useful information, but being no expert with docker I failed to do so on my mac :) (I just cloned this repo, went to ./base and run docker build -t gsabran/meteord .)

For additional context, I'm using mupx to deploy, referencing this docker image.

[Build Error] /opt/meteord/lib/build_app.sh: line 21: 84 Killed meteor build --allow-superuser --directory $BUNDLE_DIR --server=http://localhost:3000

I got this error when trying docker build -t yourname/app .
After Node#moveTo was deprecated. Use Container#append. it stays silent for 20-30 minutes, then this error shows.

Sending build context to Docker daemon  9.252MB
Step 1/1 : FROM abernix/meteord:onbuild
onbuild: Pulling from abernix/meteord
c20dc0c5afeb: Pull complete 
a3ed95caeb02: Pull complete 
52781f451a84: Pull complete 
5f8feca11b31: Pull complete 
649129398dc3: Pull complete 
926d0760afad: Pull complete 
5a6214b54a5e: Pull complete 
Digest: sha256:3c5bc7c2759e91038478723da93fcc657eddf0d863ce6c95551cc60e7eb396fd
Status: Downloaded newer image for abernix/meteord:onbuild
# Executing 4 build triggers
 ---> Running in a23128a38a7d
Removing intermediate container a23128a38a7d
 ---> Running in 3ac49e5d3d5d
Downloading Meteor distribution

Meteor 1.7.0.1 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.

To get started fast:

  $ meteor create ~/my_cool_app
  $ cd ~/my_cool_app
  $ meteor

Or see the docs at:

  docs.meteor.com

Removing intermediate container 3ac49e5d3d5d
 ---> Running in 17f3fedcc3c8
=> Copying the app
+ COPIED_APP_PATH=/copied-app
+ BUNDLE_DIR=/tmp/bundle-dir
+ echo '=> Copying the app'
+ cp -R /app /copied-app
=> Executing NPM install --production
+ cd /copied-app
+ echo '=> Executing NPM install --production'
+ meteor npm install --production

> [email protected] install /copied-app/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/copied-app/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
added 320 packages from 577 contributors in 12.075s
[!] 5 vulnerabilities found [777 packages audited]
    Severity: 1 Low | 4 High
    Run `npm audit` for more detail

+ echo '=> Executing Meteor Build...'
+ export
+ meteor build --allow-superuser --directory /tmp/bundle-dir --server=http://localhost:3000
=> Executing Meteor Build...
declare -x HOME="/root"
declare -x HOSTNAME="f4c507225b25"
declare -x METEORD_DIR="/opt/meteord"
declare -x NODE_VERSION="4.8.7"
declare -x OLDPWD="/"
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x PWD="/copied-app"
declare -x SHLVL="1"

Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the root of your project:

  sudo chown -Rh <username> .meteor/local

Node#moveTo was deprecated. Use Container#append.
/opt/meteord/lib/build_app.sh: line 21:    84 Killed                  meteor build --allow-superuser --directory $BUNDLE_DIR --server=http://localhost:3000
The command '/bin/sh -c bash $METEORD_DIR/lib/build_app.sh' returned a non-zero code: 137

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.