Meteor does not provide an official Dockerfile, so this repo will try to follow all versions and release them as docker images, so we can speed up our build Meteor Docker images where we need them and allows for easy multi-stage Dockerfile deployment.
NOTE: This is x86 image only!
Image | Meteor | Ubuntu |
---|---|---|
megawebmaster/meteor:1.10.1-1 | 1.10.1 | bionic |
megawebmaster/meteor:1.10.2-1 | 1.10.2 | bionic |
megawebmaster/meteor:1.11-1 | 1.11 | bionic |
megawebmaster/meteor:1.11.1-1 | 1.11.1 | bionic |
megawebmaster/meteor:1.12.1-1 | 1.12.1 | bionic |
megawebmaster/meteor:2.0-1 | 2.0 | bionic |
megawebmaster/meteor:2.1-1 | 2.1 | bionic |
megawebmaster/meteor:2.3-1 | 2.3 | bionic |
megawebmaster/meteor:2.3.2-1 | 2.3.2 | bionic |
megawebmaster/meteor:2.3.5-1 | 2.3.5 | bionic |
megawebmaster/meteor:2.3.6-1 | 2.3.6 | bionic |
megawebmaster/meteor:2.5-1 | 2.5 | bionic |
megawebmaster/meteor:2.5.1-1 | 2.5.1 | bionic |
megawebmaster/meteor:2.5.6-1 | 2.5.6 | bionic |
megawebmaster/meteor:2.5.6-2 | 2.5.6 | focal |
megawebmaster/meteor:2.6.1-1 | 2.6.1 | focal |
megawebmaster/meteor:2.7.1-1 | 2.7.1 | focal |
megawebmaster/meteor:2.7.2-1 | 2.7.2 | focal |
megawebmaster/meteor:2.7.3-1 | 2.7.3 | focal |
megawebmaster/meteor:2.8.1-1 | 2.8.1 | focal |
megawebmaster/meteor:2.9.0-1 | 2.9.0 | focal |
There are multiple ways how you can use this meteor docker image but basically you
have to add a file named Dockerfile
to the root of your app and run docker build .
Here are some examples of Dockerfiles that you could use:
FROM megawebmaster/meteor:1.11-1 as bundler
RUN adduser -D -u 501 -h /home/meteor meteor
ADD . /source
WORKDIR /source
USER meteor
RUN meteor npm install
CMD meteor --no-release-check
FROM megawebmaster/meteor:2.5-1 as source
WORKDIR /source
COPY package.json package-lock.json /source/
RUN meteor npm ci --quiet --no-progress
COPY . /source/
FROM source as bundler
RUN BROWSERSLIST_IGNORE_OLD_DATA=1 METEOR_DISABLE_OPTIMISTIC_CACHING=1 \
meteor build --server-only --platforms=web.browser --allow-superuser --directory /bundle
FROM node:14.18.1-alpine as rebuilder
RUN apk add --no-cache --update --quiet make gcc g++ python
WORKDIR /rebuild/programs/server
COPY --from=bundler /bundle/bundle /rebuild
RUN npm install --quiet --no-progress && npm run install
FROM node:14.18.1-alpine as runtime
RUN apk add --no-cache --update --quiet tini
RUN adduser -D -u 1001 meteor
ENV MONGO_URL="mongodb://mongo:27017/db" \
ROOT_URL="http://localhost:3000" \
PORT=3000 \
NODE_ENV="production"
COPY --from=rebuilder /rebuild /webapp
EXPOSE 3000
USER meteor
WORKDIR /webapp
ENTRYPOINT ["/sbin/tini"]
CMD ["/usr/local/bin/node", "main.js"]