Update dockerfile copy files
This commit is contained in:
parent
2d20d60ddb
commit
91eb32ff49
1 changed files with 11 additions and 36 deletions
|
|
@ -56,9 +56,6 @@ RUN sed -i "s/'flattened'/'flat_object'/g" /opt/zammad/lib/search_index_backend.
|
||||||
RUN touch db/schema.rb && \
|
RUN touch db/schema.rb && \
|
||||||
ZAMMAD_SAFE_MODE=1 DATABASE_URL=postgresql://zammad:/zammad bundle exec rake assets:precompile
|
ZAMMAD_SAFE_MODE=1 DATABASE_URL=postgresql://zammad:/zammad bundle exec rake assets:precompile
|
||||||
|
|
||||||
# Run additional setup for addons
|
|
||||||
RUN bundle exec rails runner /opt/zammad/contrib/link/setup.rb || true
|
|
||||||
|
|
||||||
# Clean up build artifacts
|
# Clean up build artifacts
|
||||||
RUN rm -rf tmp/cache node_modules/.cache
|
RUN rm -rf tmp/cache node_modules/.cache
|
||||||
ARG EMBEDDED=false
|
ARG EMBEDDED=false
|
||||||
|
|
@ -78,6 +75,14 @@ RUN if [ "$EMBEDDED" = "true" ] ; then \
|
||||||
echo "}" >> /opt/zammad/contrib/nginx/zammad.conf; \
|
echo "}" >> /opt/zammad/contrib/nginx/zammad.conf; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Modify entrypoint to install packages and run migrations at runtime
|
||||||
|
RUN sed -i '/^[[:space:]]*# es config/a\
|
||||||
|
echo "Installing addon packages..."\n\
|
||||||
|
bundle exec rails runner /opt/zammad/contrib/link/setup.rb\n\
|
||||||
|
bundle exec rake zammad:package:migrate\n\
|
||||||
|
' /docker-entrypoint.sh
|
||||||
|
|
||||||
FROM zammad/zammad-docker-compose:${ZAMMAD_VERSION} AS runner
|
FROM zammad/zammad-docker-compose:${ZAMMAD_VERSION} AS runner
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
|
@ -88,37 +93,7 @@ RUN apt-get update && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
npm install -g pnpm
|
npm install -g pnpm
|
||||||
|
|
||||||
# Copy only the modified/added files from builder
|
|
||||||
# Copy addon files that were installed
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/frontend/apps/desktop/pages/ticket/components/TicketDetailView/ /opt/zammad/app/frontend/apps/desktop/pages/ticket/components/TicketDetailView/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/frontend/shared/entities/ticket-article/action/plugins/ /opt/zammad/app/frontend/shared/entities/ticket-article/action/plugins/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/db/addon/ /opt/zammad/db/addon/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/assets/ /opt/zammad/app/assets/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/controllers/*cdr* /opt/zammad/app/controllers/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/jobs/*cdr* /opt/zammad/app/jobs/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/models/channel/driver/*cdr* /opt/zammad/app/models/channel/driver/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/models/ticket/article/*cdr* /opt/zammad/app/models/ticket/article/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/policies/controllers/*cdr* /opt/zammad/app/policies/controllers/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/config/initializers/*cdr* /opt/zammad/config/initializers/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/config/routes/*cdr* /opt/zammad/config/routes/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/lib/cdr* /opt/zammad/lib/
|
|
||||||
# CRITICAL: Copy modified search_index_backend.rb with OpenSearch fix
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/lib/search_index_backend.rb /opt/zammad/lib/search_index_backend.rb
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/images/icons/*cdr* /opt/zammad/public/assets/images/icons/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/app/views/mailer/ticket_create/ /opt/zammad/app/views/mailer/ticket_create/
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/images/logo* /opt/zammad/public/assets/images/
|
|
||||||
|
|
||||||
# Copy the nginx config if embedded mode was used
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/contrib/nginx/zammad.conf /opt/zammad/contrib/nginx/zammad.conf
|
|
||||||
|
|
||||||
# Copy the link setup scripts and addons
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/contrib/link/ /opt/zammad/contrib/link/
|
|
||||||
|
|
||||||
# CRITICAL: Copy compiled assets that include our CoffeeScript changes
|
|
||||||
# The builder stage compiles assets at line 47, we must copy them to runner
|
|
||||||
COPY --from=builder --chown=zammad:zammad /opt/zammad/public/assets/ /opt/zammad/public/assets/
|
|
||||||
|
|
||||||
# Copy the modified entrypoint script
|
|
||||||
COPY --from=builder /docker-entrypoint.sh /docker-entrypoint.sh
|
|
||||||
|
|
||||||
USER zammad
|
USER zammad
|
||||||
|
COPY --from=builder --chown=zammad:zammad ${ZAMMAD_DIR} ${ZAMMAD_DIR}
|
||||||
|
COPY --from=builder /usr/local/bundle /usr/local/bundle
|
||||||
|
COPY --from=builder /docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue