Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ##
  2. ## STAGE 1
  3. ##
  4. FROM node:12-slim AS builder
  5. LABEL maintainer Yuki Takei <yuki@weseek.co.jp>
  6. ENV APP_VERSION v3.5.13
  7. ENV APP_DIR /opt/growi
  8. ARG ARCHIVE_NAME=${APP_VERSION}
  9. RUN mkdir -p ${APP_DIR}
  10. # download GROWI archive from Github
  11. RUN curl -SL https://github.com/weseek/growi/archive/${ARCHIVE_NAME}.tar.gz \
  12. | tar -xz -C ${APP_DIR} --strip-components 1
  13. WORKDIR ${APP_DIR}
  14. # setup
  15. RUN yarn config set network-timeout 300000
  16. RUN yarn
  17. # install official plugins
  18. RUN yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs
  19. # install peerDependencies
  20. RUN yarn add -D react-images react-motion
  21. # build
  22. RUN npm run build:prod
  23. # shrink dependencies for production
  24. RUN yarn install --production
  25. ##
  26. ## STAGE 2
  27. ##
  28. FROM node:12-alpine
  29. LABEL maintainer Yuki Takei <yuki@weseek.co.jp>
  30. ENV APP_DIR /opt/growi
  31. # install tini
  32. RUN apk add --no-cache tini
  33. USER node
  34. COPY --from=builder ${APP_DIR} ${APP_DIR}
  35. WORKDIR ${APP_DIR}
  36. VOLUME /data
  37. EXPOSE 3000
  38. ENTRYPOINT ["/sbin/tini", "-e", "143", "--"]
  39. CMD ["npm", "run", "server:prod"]