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.

45 lines
1.1 KiB

  1. # =========================
  2. # --- BUILD NPM MODULES ---
  3. # =========================
  4. FROM node:18-alpine AS build
  5. RUN apk add yarn g++ make cmake python3 --no-cache
  6. WORKDIR /wiki
  7. COPY ./package.json ./package.json
  8. COPY ./patches ./patches
  9. RUN yarn --production --frozen-lockfile --non-interactive --network-timeout 100000
  10. RUN yarn patch-package
  11. # ===============
  12. # --- Release ---
  13. # ===============
  14. FROM node:18-alpine
  15. LABEL maintainer="requarks.io"
  16. RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
  17. mkdir -p /wiki && \
  18. mkdir -p /logs && \
  19. mkdir -p /wiki/data/content && \
  20. chown -R node:node /wiki /logs
  21. WORKDIR /wiki
  22. COPY --chown=node:node ./build/assets ./assets
  23. COPY --chown=node:node --from=build /wiki/node_modules ./node_modules
  24. COPY --chown=node:node ./server ./server
  25. COPY --chown=node:node ./build/server/views ./server/views
  26. COPY --chown=node:node ./dev/build/config.yml ./config.yml
  27. COPY --chown=node:node ./build/package.json ./package.json
  28. COPY --chown=node:node ./LICENSE ./LICENSE
  29. USER node
  30. VOLUME ["/wiki/data/content"]
  31. EXPOSE 3000
  32. EXPOSE 3443
  33. CMD ["node", "server"]