Dockerfile 1.2 KB

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