Skip to content
Merged
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
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"]