Anyexyz commited on
Commit
8c2e566
1 Parent(s): 6783cbf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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-s3 \
16
- --with github.com/apache/incubator-answer-plugins/storage-aliyunoss \
17
- --with github.com/apache/incubator-answer-plugins/search-elasticsearch \
18
- --output /usr/bin/new_answer
19
-
20
- FROM alpine
21
- LABEL maintainer="linkinstar@apache.org"
22
-
23
- ARG TIMEZONE
24
- ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
25
-
26
- RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
27
-
28
- RUN apk update \
29
- && apk --no-cache add \
30
- bash \
31
- ca-certificates \
32
- curl \
33
- dumb-init \
34
- gettext \
35
- openssh \
36
- sqlite \
37
- gnupg \
38
- tzdata \
39
- && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
40
- && echo "${TIMEZONE}" > /etc/timezone
41
-
42
- COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
43
- COPY --from=answer-builder /data /data
44
- COPY --from=answer-builder /entrypoint.sh /entrypoint.sh
45
- RUN chmod 755 /entrypoint.sh
46
-
47
- VOLUME /data
48
- EXPOSE 80
 
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"]