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.

50 lines
1.2 KiB

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