Anyexyz commited on
Commit
6783cbf
1 Parent(s): 5e243c4

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]