Dockerfile 979 B

1234567891011121314151617181920212223242526272829303132
  1. FROM node:16.18.0-slim as node
  2. FROM ruby:3.0.4-slim AS builder
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. ARG RAILS_ENV=production
  5. ARG ZAMMAD_TMP_DIR=/tmp/zammad
  6. COPY --from=node /opt /opt
  7. COPY --from=node /usr/local/bin /usr/local/bin
  8. SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
  9. WORKDIR ${ZAMMAD_TMP_DIR}
  10. COPY . .
  11. RUN contrib/docker/setup.sh builder
  12. # note: zammad is currently incompatible to alpine because of:
  13. # https://github.com/docker-library/ruby/issues/113
  14. FROM ruby:3.0.4-slim
  15. ARG DEBIAN_FRONTEND=noninteractive
  16. ARG ZAMMAD_USER=zammad
  17. ENV RAILS_ENV=production
  18. ENV RAILS_LOG_TO_STDOUT=true
  19. ENV ZAMMAD_DIR=/opt/zammad
  20. ENV ZAMMAD_TMP_DIR=/tmp/zammad
  21. COPY --from=builder ${ZAMMAD_TMP_DIR} ${ZAMMAD_TMP_DIR}
  22. COPY --from=builder /usr/local/bundle /usr/local/bundle
  23. COPY --from=builder ${ZAMMAD_TMP_DIR}/contrib/docker/docker-entrypoint.sh /
  24. WORKDIR ${ZAMMAD_TMP_DIR}
  25. RUN contrib/docker/setup.sh runner
  26. ENTRYPOINT ["/docker-entrypoint.sh"]
  27. USER zammad
  28. WORKDIR ${ZAMMAD_DIR}