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.3 KiB

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