forked from open-telegram-server/chatengine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
62 lines (50 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM golang:1.12.12 AS builder
ENV CGO_ENABLED 0
ENV TARGET_DIR $GOPATH/src/github.com/PluralityNET/PluralityServer
RUN echo $GOPATH
RUN mkdir -p $TARGET_DIR
RUN cd $TARGET_DIR
COPY . $TARGET_DIR/
# build biz_server
RUN cd ${TARGET_DIR}/messenger/biz_server && go build -ldflags='-s -w'
# build document
RUN cd ${TARGET_DIR}/service/document && go build -ldflags='-s -w'
# build auth_session
RUN cd ${TARGET_DIR}/service/auth_session && go build -ldflags='-s -w'
# build sync
RUN cd ${TARGET_DIR}/messenger/sync && go build -ldflags='-s -w'
# build upload
RUN cd ${TARGET_DIR}/messenger/upload && go build -ldflags='-s -w'
# build auth_key
RUN cd ${TARGET_DIR}/access/auth_key && go build -ldflags='-s -w'
# build session
RUN cd ${TARGET_DIR}/access/session && go build -ldflags='-s -w'
# build frontend
RUN cd ${TARGET_DIR}/access/frontend && go build -ldflags='-s -w'
FROM alpine:3.10.3
RUN apk add --no-cache ca-certificates tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ENV TARGET_DIR /go/src/github.com/PluralityNET/PluralityServer
WORKDIR /app/
COPY ./entrypont.sh /app/
RUN mkdir -p /app/config-templates
# build document
COPY --from=builder ${TARGET_DIR}/service/document/document ./
# build auth_session
COPY --from=builder ${TARGET_DIR}/service/auth_session/auth_session ./
# build sync
COPY --from=builder ${TARGET_DIR}/messenger/sync/sync ./
# build upload
COPY --from=builder ${TARGET_DIR}/messenger/upload/upload ./
# build biz_server
COPY --from=builder ${TARGET_DIR}/messenger/biz_server/biz_server ./
# build auth_key
COPY --from=builder ${TARGET_DIR}/access/auth_key/auth_key ./
# build session
COPY --from=builder ${TARGET_DIR}/access/session/session ./
# build frontend
COPY --from=builder ${TARGET_DIR}/access/frontend/frontend ./
# copy configs
COPY --from=builder ${TARGET_DIR}/scripts/config/*.toml ./config-templates/
COPY --from=builder ${TARGET_DIR}/scripts/config/*.json ./config-templates/
COPY --from=builder ${TARGET_DIR}/scripts/config/*.key ./config-templates/
ENTRYPOINT sh /app/entrypont.sh