-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#750 which I think solves #892 (comment) because it locks down to .meteor/release
- Loading branch information
Kai Hendry
committed
Feb 7, 2020
1 parent
c972242
commit 3a16d30
Showing
1 changed file
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |