Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM node:20-slim as node
  2. RUN npm -g install pnpm
  3. RUN rm /usr/local/bin/yarn /usr/local/bin/yarnpkg
  4. FROM ruby:3.2.4-slim AS builder
  5. ARG DEBIAN_FRONTEND=noninteractive
  6. ARG RAILS_ENV=production
  7. ARG ZAMMAD_DIR=/opt/zammad
  8. COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
  9. COPY --from=node /usr/local/bin /usr/local/bin
  10. SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
  11. WORKDIR ${ZAMMAD_DIR}
  12. COPY . .
  13. RUN contrib/docker/setup.sh builder
  14. # note: zammad is currently incompatible to alpine because of:
  15. # https://github.com/docker-library/ruby/issues/113
  16. FROM ruby:3.2.4-slim
  17. ARG DEBIAN_FRONTEND=noninteractive
  18. ARG ZAMMAD_USER=zammad
  19. ENV RAILS_ENV=production
  20. ENV RAILS_LOG_TO_STDOUT=true
  21. ENV ZAMMAD_DIR=/opt/zammad
  22. WORKDIR ${ZAMMAD_DIR}
  23. COPY --from=builder ${ZAMMAD_DIR} .
  24. COPY --from=builder /usr/local/bundle /usr/local/bundle
  25. COPY --from=builder ${ZAMMAD_DIR}/contrib/docker/docker-entrypoint.sh /
  26. RUN contrib/docker/setup.sh runner
  27. USER zammad:zammad
  28. ENTRYPOINT ["/docker-entrypoint.sh"]
  29. # Set labels to help portainer.io admins to access the shell and rails console.
  30. LABEL io.portainer.commands.bash-via-entrypoint="/docker-entrypoint.sh /bin/bash"
  31. LABEL io.portainer.commands.rails-console="/docker-entrypoint.sh bundle exec rails c"