Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 14.17.1 support for new Meteor version 2.3 #59

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
machine: true
environment:
NODE_VERSION: 12.20.0
NODE_VERSION: 14.17.1
steps:
- checkout
- run:
Expand All @@ -28,7 +28,7 @@ jobs:
binbuild
"
NODE_MAJOR="$(echo $NODE_VERSION | cut -d '.' -f1)"
DOCKER_HUB_REPO="abernix/meteord"
DOCKER_HUB_REPO="liitfr/meteord"
BASE_IMAGE_NAME="${DOCKER_HUB_REPO}:node-"
IMAGE_NAME_VERSION="${BASE_IMAGE_NAME}${NODE_VERSION}"
IMAGE_NAME_MAJOR="${BASE_IMAGE_NAME}${NODE_MAJOR}"
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Mathias Hoffmann
Copyright (c) 2018 Jesse Rosenberger
Copyright (c) 2015 MeteorHacks Pvt Ltd (Sri Lanka). <hello@meteorhacks.com>

Expand Down
87 changes: 48 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
[![Circle CI](https://circleci.com/gh/abernix/meteord/tree/master.svg?style=svg)](https://circleci.com/gh/abernix/meteord/tree/master)
[![Circle CI](https://circleci.com/gh/liitfr/meteord/tree/master.svg?style=svg)](https://circleci.com/gh/liitfr/meteord/tree/master)

# MeteorD - Docker image for MUP

## Supported tags

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

### Node 14 (Meteor 2.3+)

#### Node 14.17.1

- `node-14-base`, `node-14.17.1-base`
- `node-14-binbuild`, `node-14.17.1-binbuild`
- `node-14-onbuild`, `node-14.17.1-onbuild`
- `node-14-devbuild`, `node-14.17.1-devbuild`

### 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-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`
- `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](https://hub.docker.com/r/abernix/meteord/tags/) above.
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](https://hub.docker.com/r/liitfr/meteord/tags/) above.

## Tag Variations

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

* `-base`
* `-binbuild`
* `-onbuild`
* `-devbuild`

- `-base`
- `-binbuild`
- `-onbuild`
- `-devbuild`

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

Expand All @@ -50,78 +57,80 @@ There are two main ways you can use Docker with Meteor apps. They are:

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:
For that, you can use `liitfr/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:

~~~shell
FROM abernix/meteord:onbuild
~~~
```shell
FROM liitfr/meteord:onbuild
```

Then you can build the docker image with:

~~~shell
```shell
docker build -t yourname/app .
~~~
```

Then you can run your meteor image with

~~~shell
```shell
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.
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 `liitfr/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.
> WARNING: Don't use `liitfr/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

~~~shell
```shell
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
~~~
liitfr/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.

~~~shell
```shell
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:

~~~shell
```shell
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
~~~
liitfr/meteord:base
```

#### 2.2 With Docker Compose

docker-compose.yml
~~~shell

```shell
dashboard:
image: yourrepo/yourapp
ports:
Expand All @@ -135,7 +144,7 @@ dashboard:

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.

Expand All @@ -145,13 +154,13 @@ This sample docker-compose.yml file starts up a container that has used abernix/

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.

~~~shell
```shell
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
~~~
liitfr/meteord:binbuild
```
6 changes: 3 additions & 3 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM debian:stretch
MAINTAINER Jesse Rosenberger
LABEL maintainer="Mathias Hoffmann"

ENV METEORD_DIR /opt/meteord
COPY scripts $METEORD_DIR

ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ENV NODE_VERSION ${NODE_VERSION:-14.17.1}
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-14.17.1}

RUN bash $METEORD_DIR/lib/install_base.sh
RUN bash $METEORD_DIR/lib/install_node.sh
Expand Down
2 changes: 1 addition & 1 deletion base/scripts/lib/install_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ mv ${NODE_DIST} /opt/nodejs
ln -sf /opt/nodejs/bin/node /usr/bin/node
ln -sf /opt/nodejs/bin/npm /usr/bin/npm

npm install --global npm@6
npm install --global npm@6.14.13
4 changes: 2 additions & 2 deletions base/scripts/run_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
fi

if [[ $REBUILD_NPM_MODULES ]]; then
echo "=> abernix/meteord:bin-build is NOT TESTED AT ALL (and maybe not necessary???)"
echo "=> liitfr/meteord:bin-build is NOT TESTED AT ALL (and maybe not necessary???)"
echo " Since Meteor handles rebuilding binary dependencies itself now, it's not entirely"
echo " clear to me if this particular image is still necessary. If you are receiving"
echo " this message, I highly recommend trying the :base image without the REBUILD_NPM_MODULES"
Expand All @@ -34,7 +34,7 @@ if [[ $REBUILD_NPM_MODULES ]]; then
bash /opt/meteord/rebuild_npm_modules.sh
cd ../../
else
echo "=> Use abernix/meteord:bin-build for binary bulding."
echo "=> Use liitfr/meteord:bin-build for binary bulding."
exit 1
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions binbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM abernix/meteord:base
MAINTAINER Jesse Rosenberger
FROM liitfr/meteord:node-14-base
LABEL maintainer="Mathias Hoffmann"

ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ENV NODE_VERSION ${NODE_VERSION:-14.17.1}

COPY scripts/install_binbuild_tools.sh $METEORD_DIR/install_binbuild_tools.sh
COPY scripts/rebuild_npm_modules.sh $METEORD_DIR/rebuild_npm_modules.sh
Expand Down
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
machine:
node:
version: 12.20.0
version: 14.17.1
services:
- docker
environment:
NODE_VERSION: 12.20.0
NODE_VERSION: 14.17.1

dependencies:
pre:
Expand Down Expand Up @@ -35,7 +35,7 @@ deployment:
binbuild
"
NODE_MAJOR="$(echo $NODE_VERSION | cut -d '.' -f1)"
DOCKER_HUB_REPO="abernix/meteord"
DOCKER_HUB_REPO="liitfr/meteord"
BASE_IMAGE_NAME="${DOCKER_HUB_REPO}:node-"
IMAGE_NAME_VERSION="${BASE_IMAGE_NAME}${NODE_VERSION}"
IMAGE_NAME_MAJOR="${BASE_IMAGE_NAME}${NODE_MAJOR}"
Expand Down
6 changes: 3 additions & 3 deletions devbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM abernix/meteord:base
MAINTAINER Jesse Rosenberger
FROM liitfr/meteord:node-14-base
LABEL maintainer="Mathias Hoffmann"

ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ENV NODE_VERSION ${NODE_VERSION:-14.17.1}

ONBUILD RUN bash $METEORD_DIR/lib/install_meteor.sh
ONBUILD COPY ./ /app
Expand Down
8 changes: 4 additions & 4 deletions onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM abernix/meteord:base
MAINTAINER Jesse Rosenberger
FROM liitfr/meteord:node-14-base
LABEL maintainer="Mathias Hoffmann"

ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-12.20.0}
ENV NODE_VERSION ${NODE_VERSION:-14.17.1}
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-14.17.1}

ONBUILD COPY ./ /app
ONBUILD RUN bash $METEORD_DIR/lib/install_meteor.sh
Expand Down
16 changes: 8 additions & 8 deletions tests/build_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ set -x

: ${NODE_VERSION?"NODE_VERSION has not been set."}

docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "abernix/meteord:node-${NODE_VERSION}-base" ../base && \
docker tag "abernix/meteord:node-${NODE_VERSION}-base" abernix/meteord:base
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "abernix/meteord:node-${NODE_VERSION}-onbuild" ../onbuild && \
docker tag "abernix/meteord:node-${NODE_VERSION}-onbuild" abernix/meteord:onbuild
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "abernix/meteord:node-${NODE_VERSION}-devbuild" ../devbuild && \
docker tag "abernix/meteord:node-${NODE_VERSION}-devbuild" abernix/meteord:devbuild
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "abernix/meteord:node-${NODE_VERSION}-binbuild" ../binbuild && \
docker tag "abernix/meteord:node-${NODE_VERSION}-binbuild" abernix/meteord:binbuild
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "liitfr/meteord:node-${NODE_VERSION}-base" ../base && \
docker tag "liitfr/meteord:node-${NODE_VERSION}-base" liitfr/meteord:base
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "liitfr/meteord:node-${NODE_VERSION}-onbuild" ../onbuild && \
docker tag "liitfr/meteord:node-${NODE_VERSION}-onbuild" liitfr/meteord:onbuild
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "liitfr/meteord:node-${NODE_VERSION}-devbuild" ../devbuild && \
docker tag "liitfr/meteord:node-${NODE_VERSION}-devbuild" liitfr/meteord:devbuild
docker build --build-arg "NODE_VERSION=${NODE_VERSION}" -t "liitfr/meteord:node-${NODE_VERSION}-binbuild" ../binbuild && \
docker tag "liitfr/meteord:node-${NODE_VERSION}-binbuild" liitfr/meteord:binbuild
2 changes: 1 addition & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
set -x

export NODE_VERSION=${NODE_VERSION:-12.20.0}
export NODE_VERSION=${NODE_VERSION:-14.17.1}

bash ./build_it.sh

Expand Down
4 changes: 2 additions & 2 deletions tests/test_binary_build_on_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ docker run -d \
-e BUNDLE_URL=https://abernix-meteord-tests.s3-us-west-2.amazonaws.com/meteord-test-bundle.tar.gz \
-e REBUILD_NPM_MODULES=1 \
-p 9090:80 \
"abernix/meteord:node-${NODE_VERSION}-base"
"liitfr/meteord:node-${NODE_VERSION}-base"

echo "Waiting for binary building is happening"
sleep 80

appContent=`docker logs binary_build`
clean

if [[ $appContent != *"abernix/meteord:bin-build"* ]]; then
if [[ $appContent != *"liitfr/meteord:bin-build"* ]]; then
echo "Failed: Trying to binary building on the base image"
exit 1
fi
2 changes: 1 addition & 1 deletion tests/test_binary_build_on_bin_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker run -d \
-e BUNDLE_URL=https://abernix-meteord-tests.s3-us-west-2.amazonaws.com/meteord-test-bundle.tar.gz \
-e REBUILD_NPM_MODULES=1 \
-p 9090:80 \
"abernix/meteord:node-${NODE_VERSION}-binbuild"
"liitfr/meteord:node-${NODE_VERSION}-binbuild"

echo "Waiting for binary building is happening"
sleep 80
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bundle_local_mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function clean() {
cd /tmp
clean

meteor create --release 1.12 localmount
meteor create --release 2.3 localmount
cd localmount
meteor build --architecture=os.linux.x86_64 ./
pwd
Expand All @@ -23,7 +23,7 @@ docker run -d \
-e ROOT_URL=http://localmount_app \
-v /tmp/localmount:/bundle \
-p 9090:80 \
"abernix/meteord:node-${NODE_VERSION}-base"
"liitfr/meteord:node-${NODE_VERSION}-base"

sleep 50

Expand Down
Loading