forked from jshimko/meteor-launchpad
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
executable file
·50 lines (36 loc) · 1.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM debian:stable
RUN groupadd -r node && useradd -m -g node node
# build directories
ENV APP_SOURCE_DIR /opt/meteor/src
ENV APP_BUNDLE_DIR /opt/meteor/dist
ENV BUILD_SCRIPTS_DIR /opt/build_scripts
# Add entrypoint and build scripts
COPY scripts $BUILD_SCRIPTS_DIR
RUN chmod -R 750 $BUILD_SCRIPTS_DIR
ONBUILD ENV METEOR_DISABLE_OPTIMISTIC_CACHING 1
# Define all --build-arg options
ONBUILD ARG NODE_VERSION
ONBUILD ENV NODE_VERSION ${NODE_VERSION:-14.17.4}
ONBUILD ARG NPM_TOKEN
ONBUILD ENV NPM_TOKEN $NPM_TOKEN
# Node flags for the Meteor build tool
ONBUILD ARG TOOL_NODE_FLAGS
ONBUILD ENV TOOL_NODE_FLAGS $TOOL_NODE_FLAGS
# copy the app to the container
ONBUILD COPY . $APP_SOURCE_DIR
# install all dependencies, build app, clean up
ONBUILD RUN cd $APP_SOURCE_DIR && \
bash -l $BUILD_SCRIPTS_DIR/install-deps.sh && \
bash -l $BUILD_SCRIPTS_DIR/install-node.sh && \
bash -l $BUILD_SCRIPTS_DIR/install-meteor.sh && \
bash -l $BUILD_SCRIPTS_DIR/build-meteor.sh && \
bash -l $BUILD_SCRIPTS_DIR/post-build-cleanup.sh
# Default values for Meteor environment variables
ENV ROOT_URL http://localhost
ENV MONGO_URL mongodb://127.0.0.1:27017/meteor
ENV PORT 3000
EXPOSE 3000
WORKDIR $APP_BUNDLE_DIR/bundle
# start the app
ENTRYPOINT ["./entrypoint.sh"]
CMD ["node", "main.js"]