We’ve been using Heroku and the https://github.com/AdmitHub/meteor-buildpack-horse buildpack to successfully deploy production apps. It’s got a decent workflow with a good set of tools and utilities and a pipeline.
We’d like to migrate to AWS. What’s the consensus on the best methodolgy to do so? I’ve read about Meteor UP. Will things not be as automated on AWS bc of us having a dedicated linux VM and needing to manually setup start scripts, DBs, and what not?
https://aws.amazon.com/marketplace/pp/Elastrix-Meteor/B01BM4EBJI looks convenient
Probably MUP. Also waveshosting.com is decent.
Meteor UP uses dockers. If you prefer a more bare metal approach, you can try yamup.
Our preference is using published docker images and ECS Fargate. Our docker image is based on https://github.com/disney/meteor-base but we opted to simplify it to not use multistage and modify it to our needs.
The build script is basically
- Build tgz bundle using meteor build
- Build Dockerfile using an alpine base image
- Add prerequisites
- Copy in bundle
- Build native npm packages (like bcrypt)
- Push docker image to private repo
- Modify ECS settings using the method described here
Our Dockerfile, for reference:
# For Meteor 1.11.1
# RUN apk add --update --no-cache bind-tools curl jq
RUN apk add tzdata && cp /usr/share/zoneinfo/Europe/Stockholm /etc/localtime
# you need to copy the bundle to the .docker dir first since Dockerfiles cannot escape their root directory
ENV GIT_HASH $GIT_HASH
ENV DOCKER_TAG $DOCKER_TAG
ENV APP_BUNDLE_FOLDER /opt/bundle
ENV SCRIPTS_FOLDER /docker
LABEL ECS_TASK_TEMPLATE $ECS_TASK_TEMPLATE
# Install OS build dependencies, which we remove later after we’ve compiled native Node extensions
RUN apk --no-cache --virtual .node-gyp-compilation-dependencies add \
# And runtime dependencies, which we keep
&& apk --no-cache add \
# Copy in scripts and supporting files
COPY ./.docker/scripts/ $SCRIPTS_FOLDER/
# prep for the entrypoint script
RUN cd $SCRIPTS_FOLDER && npm install --production
# Copy in app bundle from tarball
ADD $BUNDLE_PATH $APP_BUNDLE_FOLDER/bundle
# Build native extensions
RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh \
&& apk del .node-gyp-compilation-dependencies
ENV NODE_ENV production
# Start app
CMD ["node", "main.js"]