@@ -44,14 +44,11 @@ RUN npm run prepare && npm run postinstall
44
44
# list all dir/files - for debugging purposes
45
45
# RUN ls -al
46
46
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)
48
49
# 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
52
50
# RUN npm test
53
51
54
-
55
52
# ------- Stage 4 - Release ---------
56
53
FROM dependencies AS release
57
54
# lib is the output from babel in the build step
@@ -66,8 +63,9 @@ COPY /views ./views
66
63
# RUN ls -al
67
64
68
65
# 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
71
69
72
70
# run as non-root. USER node is provided with node images
73
71
# https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user
@@ -80,7 +78,8 @@ EXPOSE 1337
80
78
# start with node, not npm
81
79
ENTRYPOINT ["node" , "./bin/parse-server" , "--" ]
82
80
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) .
84
83
# RUN (entrypoint sh): sudo docker run --name parse-server --rm -it --entrypoint sh barakbd/parse-server:test
85
84
# to stop at a specific steps add --target flag
86
85
# sudo docker build --target release -t barakbd/parse-server:test .
0 commit comments