You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. # ====================
  2. # --- Build Assets ---
  3. # ====================
  4. FROM node:10.16-alpine AS assets
  5. RUN apk add yarn g++ make python --no-cache
  6. WORKDIR /wiki
  7. COPY ./client ./client
  8. COPY ./dev ./dev
  9. COPY ./package.json ./package.json
  10. COPY ./.babelrc ./.babelrc
  11. COPY ./.eslintignore ./.eslintignore
  12. COPY ./.eslintrc.yml ./.eslintrc.yml
  13. RUN yarn cache clean
  14. RUN yarn --frozen-lockfile --non-interactive
  15. RUN yarn build
  16. RUN rm -rf /wiki/node_modules
  17. RUN yarn --production --frozen-lockfile --non-interactive
  18. # ===============
  19. # --- Release ---
  20. # ===============
  21. FROM node:10.16-alpine
  22. LABEL maintainer="requarks.io"
  23. RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
  24. mkdir -p /wiki && \
  25. mkdir -p /logs && \
  26. chown -R node:node /wiki /logs
  27. WORKDIR /wiki
  28. COPY --chown=node:node --from=assets /wiki/assets ./assets
  29. COPY --chown=node:node --from=assets /wiki/node_modules ./node_modules
  30. COPY --chown=node:node ./server ./server
  31. COPY --chown=node:node --from=assets /wiki/server/views ./server/views
  32. COPY --chown=node:node ./dev/build/config.yml ./config.yml
  33. COPY --chown=node:node ./dev/docker-common/wait.sh ./wait.sh
  34. COPY --chown=node:node ./package.json ./package.json
  35. COPY --chown=node:node ./LICENSE ./LICENSE
  36. USER node
  37. EXPOSE 3000
  38. # HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost/healthz
  39. CMD ["node", "server"]