FROM node:14.21.1
WORKDIR /usr/src/app
RUN curl https://install.meteor.com/ | sh
COPY . .
ENV METEOR_ALLOW_SUPERUSER=true
RUN meteor npm install --production
RUN meteor build --server-only --allow-superuser --directory ../build --architecture os.linux.x86_64
WORKDIR /usr/src/build/bundle/programs/server
RUN npm install
WORKDIR /usr/src/build/bundle
EXPOSE 3000
CMD ["node", "main.js"]
docker buildx build -t my-meteor-app .
Build goes smoothly except for this message:
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 .meteor/local
Sending build context to Docker daemon 7.713MB
Step 1/12 : FROM node:14.21.1
---> c08c80352dd3
Step 2/12 : WORKDIR /usr/src/app
---> Using cache
---> 54f4dc999c66
Step 3/12 : RUN curl https://install.meteor.com/ | sh
---> Using cache
---> dadb507c232b
Step 4/12 : COPY . .
---> 8f782cedddad
Step 5/12 : ENV METEOR_ALLOW_SUPERUSER=true
---> Running in 90e2ae911d98
---> Removed intermediate container 90e2ae911d98
---> 2fcca205fcba
Step 6/12 : RUN meteor npm install --production
---> Running in 87fc0199bbed
> @apollo/protobufjs@1.2.7 postinstall /usr/src/app/node_modules/@apollo/protobufjs
> node scripts/postinstall
added 839 packages from 572 contributors in 57.406s
154 packages are looking for funding
run `npm fund` for details
---> Removed intermediate container 87fc0199bbed
---> 245cc1a93ab4
Step 7/12 : RUN meteor build --server-only --allow-superuser --directory ../build --architecture os.linux.x86_64
---> Running in aacf1886821a
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
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
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
---> Removed intermediate container aacf1886821a
---> 8dd50b97bb3e
Step 8/12 : WORKDIR /usr/src/build/bundle/programs/server
---> Running in e51c323e96d2
---> Removed intermediate container e51c323e96d2
---> 0f4c793914ce
Step 9/12 : RUN npm install
---> Running in 6000b009841d
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated npmlog@4.1.2: This package is no longer supported.
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated osenv@0.1.5: This package is no longer supported.
npm WARN deprecated gauge@2.7.4: This package is no longer supported.
npm WARN deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
> fibers@5.0.1 install /usr/src/build/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js
`linux-x64-83-glibc` exists; testing
Binary is fine; exiting
npm WARN lifecycle meteor-dev-bundle@~install: cannot run in wd meteor-dev-bundle@ node npm-rebuild.js (wd=/usr/src/build/bundle/programs/server)
added 155 packages from 87 contributors and audited 156 packages in 8.476s
7 packages are looking for funding
run `npm fund` for details
found 1 moderate severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
---> Removed intermediate container 6000b009841d
---> 173c82e57e96
Step 10/12 : WORKDIR /usr/src/build/bundle
---> Running in 63b1385a1b83
---> Removed intermediate container 63b1385a1b83
---> 2e81b8fb5df2
Step 11/12 : EXPOSE 3000
---> Running in 0a21ca1980a0
---> Removed intermediate container 0a21ca1980a0
---> 56e3852761ee
Step 12/12 : CMD ["node", "main.js"]
---> Running in fdcff1ac0a55
---> Removed intermediate container fdcff1ac0a55
---> ac7d03a13bc9
Successfully built ac7d03a13bc9
Successfully tagged my-meteor-app:latest
docker ps
my-meteor-app:latest "docker-entrypoint.s…" 31 seconds ago Up 30 seconds 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp
Also on a side note, copying package.json and lock files → npm install → full copy, will be significantly faster for multiple deploys as it will cache the npm install step as long as your package jsons are not changed. Super helpful while testing multiple times.