File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
- FROM hackmdio/buildpack:1.0.4 as BUILD
1
+ ARG RUNTIME
2
+
3
+ FROM hackmdio/buildpack:node-10-0baafb79 as BUILD
2
4
3
5
COPY --chown=hackmd:hackmd . .
4
6
@@ -12,11 +14,12 @@ RUN set -xe && \
12
14
rm -rf .git .gitignore .travis.yml .dockerignore .editorconfig .babelrc .mailmap .sequelizerc.example \
13
15
test docs contribute \
14
16
package-lock.json webpack.prod.js webpack.htmlexport.js webpack.dev.js webpack.common.js \
15
- config.json.example README.md CONTRIBUTING.md AUTHORS
17
+ config.json.example README.md CONTRIBUTING.md AUTHORS node_modules
16
18
17
- FROM hackmdio/runtime:1.0.6
19
+ FROM $RUNTIME
18
20
USER hackmd
19
21
WORKDIR /home/hackmd/app
20
22
COPY --chown=1500:1500 --from=BUILD /home/hackmd/app .
23
+ RUN npm install --production && npm cache clean --force && rm -rf /tmp/{core-js-banners,phantomjs}
21
24
EXPOSE 3000
22
25
ENTRYPOINT ["/home/hackmd/app/docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ set -euo pipefail
4
+ set -x
5
+
3
6
CURRENT_DIR=$( dirname " $BASH_SOURCE " )
4
7
5
- docker build -t hackmdio/codimd -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
8
+ GIT_SHA1=" $( git rev-parse HEAD) "
9
+ GIT_SHORT_ID=" ${GIT_SHA1: 0: 8} "
10
+ GIT_TAG=$( git describe --exact-match --tags $( git log -n1 --pretty=' %h' ) 2> /dev/null || echo " " )
11
+
12
+ DOCKER_TAG=" ${GIT_TAG:- $GIT_SHORT_ID } "
13
+
14
+ docker build --build-arg RUNTIME=hackmdio/runtime:node-10-0baafb79 -t " hackmdio/hackmd:$DOCKER_TAG " -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
15
+
16
+ docker build --build-arg RUNTIME=hackmdio/runtime:node-10-cjk-0baafb79 -t " hackmdio/hackmd:$DOCKER_TAG -cjk" -f " $CURRENT_DIR /Dockerfile" " $CURRENT_DIR /.."
You can’t perform that action at this time.
0 commit comments