Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +49 -48
Dockerfile
CHANGED
|
@@ -1,49 +1,50 @@
|
|
| 1 |
-
FROM apache/answer:1.4.0 as answer-builder
|
| 2 |
-
|
| 3 |
-
FROM golang:1.19-alpine AS golang-builder
|
| 4 |
-
|
| 5 |
-
COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
|
| 6 |
-
|
| 7 |
-
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
|
| 8 |
-
|
| 9 |
-
RUN apk --no-cache add \
|
| 10 |
-
build-base git bash nodejs npm go && \
|
| 11 |
-
npm install -g pnpm@8.9.2
|
| 12 |
-
|
| 13 |
-
RUN answer build \
|
| 14 |
-
--with github.com/apache/incubator-answer-plugins/connector-basic \
|
| 15 |
-
--with github.com/apache/incubator-answer-plugins/storage-
|
| 16 |
-
--with github.com/apache/incubator-answer-plugins/
|
| 17 |
-
--with github.com/apache/incubator-answer-plugins/
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
&&
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
COPY --from=
|
| 44 |
-
COPY --from=answer-builder /
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
| 1 |
+
FROM apache/answer:1.4.0 as answer-builder
|
| 2 |
+
|
| 3 |
+
FROM golang:1.19-alpine AS golang-builder
|
| 4 |
+
|
| 5 |
+
COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
|
| 6 |
+
|
| 7 |
+
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
|
| 8 |
+
|
| 9 |
+
RUN apk --no-cache add \
|
| 10 |
+
build-base git bash nodejs npm go && \
|
| 11 |
+
npm install -g pnpm@8.9.2
|
| 12 |
+
|
| 13 |
+
RUN answer build \
|
| 14 |
+
--with github.com/apache/incubator-answer-plugins/connector-basic \
|
| 15 |
+
--with github.com/apache/incubator-answer-plugins/storage-aliyunoss \
|
| 16 |
+
--with github.com/apache/incubator-answer-plugins/search-elasticsearch \
|
| 17 |
+
--with github.com/apache/incubator-answer-plugins/captcha-basic \
|
| 18 |
+
|
| 19 |
+
--output /usr/bin/new_answer
|
| 20 |
+
|
| 21 |
+
FROM alpine
|
| 22 |
+
LABEL maintainer="linkinstar@apache.org"
|
| 23 |
+
|
| 24 |
+
ARG TIMEZONE
|
| 25 |
+
ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
|
| 26 |
+
|
| 27 |
+
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
|
| 28 |
+
|
| 29 |
+
RUN apk update \
|
| 30 |
+
&& apk --no-cache add \
|
| 31 |
+
bash \
|
| 32 |
+
ca-certificates \
|
| 33 |
+
curl \
|
| 34 |
+
dumb-init \
|
| 35 |
+
gettext \
|
| 36 |
+
openssh \
|
| 37 |
+
sqlite \
|
| 38 |
+
gnupg \
|
| 39 |
+
tzdata \
|
| 40 |
+
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
|
| 41 |
+
&& echo "${TIMEZONE}" > /etc/timezone
|
| 42 |
+
|
| 43 |
+
COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
|
| 44 |
+
COPY --from=answer-builder /data /data
|
| 45 |
+
COPY --from=answer-builder /entrypoint.sh /entrypoint.sh
|
| 46 |
+
RUN chmod 755 /entrypoint.sh
|
| 47 |
+
|
| 48 |
+
VOLUME /data
|
| 49 |
+
EXPOSE 80
|
| 50 |
ENTRYPOINT ["/entrypoint.sh"]
|