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.

56 lines
1.4 KiB

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