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.

54 lines
1.4 KiB

  1. # ====================
  2. # --- Build Assets ---
  3. # ====================
  4. FROM node:16-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 ./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: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. mkdir -p /wiki/data/content && \
  27. chown -R node:node /wiki /logs
  28. WORKDIR /wiki
  29. COPY --chown=node:node --from=assets /wiki/assets ./assets
  30. COPY --chown=node:node --from=assets /wiki/node_modules ./node_modules
  31. COPY --chown=node:node ./server ./server
  32. COPY --chown=node:node --from=assets /wiki/server/views ./server/views
  33. COPY --chown=node:node ./dev/build/config.yml ./config.yml
  34. COPY --chown=node:node ./package.json ./package.json
  35. COPY --chown=node:node ./LICENSE ./LICENSE
  36. USER node
  37. VOLUME ["/wiki/data/content"]
  38. EXPOSE 3000
  39. EXPOSE 3443
  40. # HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost:3000/healthz
  41. CMD ["node", "server"]