Skip to content

Commit

Permalink
This comes from my unmerged PR (#897)
Browse files Browse the repository at this point in the history
#750 which I think solves
#892 (comment)
because it locks down to .meteor/release
  • Loading branch information
Kai Hendry committed Feb 10, 2020
1 parent c972242 commit 3cfd038
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
FROM node:8 AS builder
FROM node:8.15.1 AS builder

RUN curl -sL https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh
RUN mkdir /src /bundle
RUN chown -R node /src /bundle
ENV BUNDLE_DIR /home/node/bundle
ENV SRC_DIR /home/node/src
ENV TMP_DIR /home/node/tmp

USER node:node

WORKDIR /src
COPY --chown=node:node . .
RUN mkdir -p $SRC_DIR $BUNDLE_DIR $TMP_DIR
COPY --chown=node:node . $SRC_DIR

RUN meteor npm install
RUN meteor build --architecture os.linux.x86_64 --directory /bundle
RUN cd /bundle/bundle/programs/server && npm install
RUN curl -o $TMP_DIR/meteor.sh 'https://install.meteor.com?release=1.8.1'; sh $TMP_DIR/meteor.sh

FROM node:8-slim
ENV PATH="/home/node/.meteor:${PATH}"
WORKDIR $SRC_DIR
RUN npm i
RUN meteor npm install --production
RUN meteor build --server-only --directory $BUNDLE_DIR
RUN cd ${BUNDLE_DIR}/bundle/programs/server && npm install

FROM node:8.15.1-slim

ENV APP_DIR /home/node/app
ENV BUNDLE_DIR /home/node/bundle

USER node:node

COPY --from=builder /bundle /app
WORKDIR /app/bundle
COPY --from=builder $BUNDLE_DIR $APP_DIR
WORKDIR $APP_DIR/bundle


ENV PORT 3000
EXPOSE 3000


CMD ["node", "./main.js"]

0 comments on commit 3cfd038

Please sign in to comment.