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.

49 lines
1.1 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-folder /codefresh/volume/yarn
  16. RUN yarn build
  17. RUN rm -rf /wiki/node_modules
  18. RUN yarn --production
  19. # ===============
  20. # --- Release ---
  21. # ===============
  22. FROM node:10.15-alpine
  23. LABEL maintainer="requarks.io"
  24. RUN apk update && \
  25. apk add bash curl git openssh supervisor --no-cache && \
  26. rm -rf /var/cache/apk/* && \
  27. mkdir -p /wiki && \
  28. mkdir -p /logs
  29. WORKDIR /wiki
  30. COPY --from=assets /wiki/assets ./assets
  31. COPY --from=assets /wiki/node_modules ./node_modules
  32. COPY ./server ./server
  33. COPY --from=assets /wiki/server/views ./server/views
  34. COPY ./dev/build/config.yml ./config.yml
  35. COPY ./dev/docker/wait.sh ./wait.sh
  36. COPY ./package.json ./package.json
  37. COPY ./LICENSE ./LICENSE
  38. EXPOSE 3000
  39. CMD ["node", "server"]