2020-05-18 04:22:40 +08:00
|
|
|
ARG RUNTIME
|
|
|
|
|
2020-05-17 19:48:17 +08:00
|
|
|
FROM hackmdio/buildpack:node-10-0baafb79 as BUILD
|
2019-08-18 02:37:34 +08:00
|
|
|
|
|
|
|
COPY --chown=hackmd:hackmd . .
|
|
|
|
|
|
|
|
RUN set -xe && \
|
|
|
|
git reset --hard && \
|
|
|
|
git clean -fx && \
|
2020-02-17 11:05:30 +08:00
|
|
|
npm install && \
|
2021-06-12 19:18:27 +08:00
|
|
|
npx tsc && \
|
2020-02-17 11:05:30 +08:00
|
|
|
npm run build && \
|
2019-08-18 02:37:34 +08:00
|
|
|
cp ./deployments/docker-entrypoint.sh ./ && \
|
|
|
|
cp .sequelizerc.example .sequelizerc && \
|
|
|
|
rm -rf .git .gitignore .travis.yml .dockerignore .editorconfig .babelrc .mailmap .sequelizerc.example \
|
|
|
|
test docs contribute \
|
2021-06-12 19:18:27 +08:00
|
|
|
webpack.prod.js webpack.htmlexport.js webpack.dev.js webpack.common.js \
|
|
|
|
config.json.example README.md CONTRIBUTING.md AUTHORS node_modules \
|
|
|
|
lib/
|
2019-08-18 02:37:34 +08:00
|
|
|
|
2020-05-18 04:22:40 +08:00
|
|
|
FROM $RUNTIME
|
2019-08-18 02:37:34 +08:00
|
|
|
USER hackmd
|
|
|
|
WORKDIR /home/hackmd/app
|
2019-10-23 00:54:02 +08:00
|
|
|
COPY --chown=1500:1500 --from=BUILD /home/hackmd/app .
|
2020-05-17 19:48:17 +08:00
|
|
|
RUN npm install --production && npm cache clean --force && rm -rf /tmp/{core-js-banners,phantomjs}
|
2019-07-30 18:09:17 +08:00
|
|
|
EXPOSE 3000
|
2019-08-18 02:37:34 +08:00
|
|
|
ENTRYPOINT ["/home/hackmd/app/docker-entrypoint.sh"]
|