@@ -44,14 +44,11 @@ RUN npm run prepare && npm run postinstall
4444# list all dir/files - for debugging purposes
4545# RUN ls -al
4646
47- # ---- UNIT TESTS AND FLOW LINT in stage 3------
47+ # UNIT TESTS
48+ # if you want to perform unit testing, do it in the build stage (tests won't be cached, since the build stage cache is invalidated when files change)
4849# do not run flow through npm - https://github.com/facebook/flow/issues/3649
49- # RUN apk add --no-cache --repository https://nl.alpinelinux.org/alpine/edge/testing flow
50- # run unit tests after COPY - any file change will invalidated cached layer and guarantees a new test run
51- # make sure flow is removed from pretest in package.json
5250# RUN npm test
5351
54-
5552# ------- Stage 4 - Release ---------
5653FROM dependencies AS release
5754# lib is the output from babel in the build step
@@ -66,8 +63,9 @@ COPY /views ./views
6663# RUN ls -al
6764
6865# capture git_commit in label
69- ARG GIT_COMMIT
70- LABEL git_commit=$GIT_COMMIT
66+ # This is used in the script in /hooks/build.sh which is a trigger used in dockerhub builds
67+ # ARG SOURCE_COMMIT
68+ # LABEL SOURCE_COMMIT=$SOURCE_COMMIT
7169
7270# run as non-root. USER node is provided with node images
7371# https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user
@@ -80,7 +78,8 @@ EXPOSE 1337
8078# start with node, not npm
8179ENTRYPOINT ["node" , "./bin/parse-server" , "--" ]
8280
83- # BUILD: docker build -t parse-platform/parse-server:test --build-arg GIT_COMMIT=$(git log -1 --format=%H) .
81+ # BUILD: docker build -t parse-platform/parse-server:test --build-arg SOURCE_COMMIT=$(git log -1 --format=%H) .
82+ # docker build -t local/parse-server:local --build-arg GIT_COMMIT=$(git log -1 --format=%H) .
8483# RUN (entrypoint sh): sudo docker run --name parse-server --rm -it --entrypoint sh barakbd/parse-server:test
8584# to stop at a specific steps add --target flag
8685# sudo docker build --target release -t barakbd/parse-server:test .
0 commit comments