Skip to content

Commit 3cfd038

Browse files
author
Kai Hendry
authored
This comes from my unmerged PR (#897)
#750 which I think solves #892 (comment) because it locks down to .meteor/release
1 parent c972242 commit 3cfd038

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

Dockerfile

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
1-
FROM node:8 AS builder
1+
FROM node:8.15.1 AS builder
22

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

77
USER node:node
88

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

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

16-
FROM node:8-slim
14+
ENV PATH="/home/node/.meteor:${PATH}"
15+
WORKDIR $SRC_DIR
16+
RUN npm i
17+
RUN meteor npm install --production
18+
RUN meteor build --server-only --directory $BUNDLE_DIR
19+
RUN cd ${BUNDLE_DIR}/bundle/programs/server && npm install
20+
21+
FROM node:8.15.1-slim
22+
23+
ENV APP_DIR /home/node/app
24+
ENV BUNDLE_DIR /home/node/bundle
1725

1826
USER node:node
1927

20-
COPY --from=builder /bundle /app
21-
WORKDIR /app/bundle
28+
COPY --from=builder $BUNDLE_DIR $APP_DIR
29+
WORKDIR $APP_DIR/bundle
30+
2231

2332
ENV PORT 3000
2433
EXPOSE 3000
2534

35+
2636
CMD ["node", "./main.js"]

0 commit comments

Comments
 (0)