Zammad Docker and addon updates

This commit is contained in:
Darren Clarke 2023-05-03 08:20:51 +00:00
parent dab5ce0521
commit aa18d3904e
16 changed files with 1972 additions and 2976 deletions

View file

@ -1,30 +1,42 @@
FROM zammad/zammad-docker-compose:5.4.1 AS builder
COPY auto_install ${ZAMMAD_TMP_DIR}/auto_install
USER root
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends git libclang-dev clang llvm pkg-config nettle-dev rustc cargo libmariadb-dev;
apt-get install -y --no-install-recommends nodejs git libclang-dev clang llvm pkg-config nettle-dev;
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ARG SEQUOIA_PROJECT_URL=https://gitlab.com/sequoia-pgp/sequoia-ffi.git
ARG SEQUOIA_GIT_TAG=main
ENV SEQUOIA_DIR=/usr/lib/sequoia
ENV LD_LIBRARY_PATH=${SEQUOIA_DIR}/target/debug
RUN git clone -b "${SEQUOIA_GIT_TAG}" --single-branch --depth 1 "${SEQUOIA_PROJECT_URL}" "${SEQUOIA_DIR}";
WORKDIR ${SEQUOIA_DIR}
RUN cargo update
RUN cargo build -p sequoia-openpgp-ffi;
RUN ls -la "${SEQUOIA_DIR}/target/debug";
# RUN chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${SEQUOIA_DIR}"
# WORKDIR ${ZAMMAD_TMP_DIR}
# RUN echo "gem 'ruby_openpgp', git: 'https://github.com/throneless-tech/ruby_openpgp', branch: 'signing-and-userids'" >> Gemfile.local ; \
# echo "gem 'rails-observers'" >> Gemfile.local ; \
# bundle update tcr; \
# bundle install --without test development mysql ;
RUN export PATH=~/.cargo/bin:$PATH && cargo build -p sequoia-openpgp-ffi;
WORKDIR ${ZAMMAD_TMP_DIR}
RUN echo "gem 'ruby_openpgp', git: 'https://github.com/throneless-tech/ruby_openpgp', branch: 'signing-and-userids'" >> Gemfile.local
RUN echo "gem 'rails-observers'" >> Gemfile.local
RUN bundle install --without test development mysql
RUN sed -i '/^[[:space:]]*# create install ready file/ i\
echo "about to reinstall..."\n\
bundle exec rake zammad:package:reinstall_all\n\
bundle exec rake zammad:package:migrate\n\
bundle exec rake assets:precompile\n\
' /docker-entrypoint.sh
FROM node:16.18.0-slim as node
FROM zammad/zammad-docker-compose:5.4.1
USER ${ZAMMAD_USER}
ENV SEQUOIA_DIR=/usr/lib/sequoia
ENV LD_LIBRARY_PATH=${SEQUOIA_DIR}/target/debug
COPY --from=node /opt /opt
COPY --from=node /usr/local/bin /usr/local/bin
COPY --from=builder ${ZAMMAD_TMP_DIR} ${ZAMMAD_TMP_DIR}
COPY --from=builder ${SEQUOIA_DIR} ${SEQUOIA_DIR}
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder /docker-entrypoint.sh /docker-entrypoint.sh
# RUN sed -i "s/# create install ready file/bundle exec rake zammad:package:migrate/g" contrib/docker/docker-entrypoint.sh
# FROM zammad/zammad-docker-compose:5.4.1
# COPY --from=builder ${ZAMMAD_TMP_DIR} ${ZAMMAD_TMP_DIR}
# COPY --from=builder ${SEQUOIA_DIR} ${SEQUOIA_DIR}
# COPY --from=builder /usr/local/bundle /usr/local/bundle