LinkinStars commented on issue #1428:
URL: https://github.com/apache/answer/issues/1428#issuecomment-3561070505

   @vipelanchen You can use docker to build an image that contains any plugins. 
Then start it with the new docker image.
   
   ```yaml
   FROM apache/answer:1.7.0 as answer-builder
   
   FROM golang:1.23.4-alpine AS golang-builder
   
   COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
   
   RUN apk --no-cache add \
       build-base git bash nodejs npm go && \
       npm install -g [email protected]
   
   RUN ANSWER_MODULE=github.com/apache/[email protected] answer build \
       --with github.com/apache/answer-plugins/user-center-wecom@latest \
       --output /usr/bin/new_answer
   
   FROM alpine:latest
   LABEL maintainer="[email protected]"
   
   ARG TIMEZONE
   ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
   
   RUN apk update \
       && apk --no-cache add \
           bash \
           ca-certificates \
           curl \
           dumb-init \
           gettext \
           openssh \
           sqlite \
           gnupg \
           tzdata \
       && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
       && echo "${TIMEZONE}" > /etc/timezone
   
   COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
   COPY --from=answer-builder /data /data
   COPY --from=answer-builder /entrypoint.sh /entrypoint.sh
   RUN chmod 755 /entrypoint.sh
   
   VOLUME /data
   EXPOSE 80
   ENTRYPOINT ["/entrypoint.sh"]
   ```
   
   You can add plugins via `--with`.
   
   FYI: https://answer.apache.org/docs/plugins#docker-build


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to