-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (37 loc) · 1.29 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
# Build all services
FROM golang:1.22-alpine AS builder
COPY . /src
WORKDIR /src
RUN GOPROXY=https://goproxy.cn GO111MODULE=on go mod download \
&& apk add --no-cache make git\
&& cd app/admin/admin && make build && cd ../.. \
&& cd user/contest && make build && cd ../.. \
&& cd public/auth && make build && cd ../.. \
&& cd judge/gojudge && make build && cd ../.. \
&& cd judge/freshcup && make build && cd ../..
FROM alpine:edge AS admin
COPY --from=builder /src/app/admin/admin/bin/admin /
EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf
CMD ["/admin", "-conf", "/data/conf"]
FROM alpine:edge AS contest
COPY --from=builder /src/app/user/contest/bin/contest /
EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf
CMD ["/contest", "-conf", "/data/conf"]
FROM alpine:edge AS public-auth
COPY --from=builder /src/app/public/auth/bin/auth /
EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf
CMD ["/auth", "-conf", "/data/conf"]
FROM alpine:edge AS gojudge-server
COPY --from=builder /src/app/judge/gojudge/bin/gojudge /
VOLUME /data/conf
CMD ["/gojudge", "-conf", "/data/conf"]
FROM alpine:edge AS freshcup-server
COPY --from=builder /src/app/judge/freshcup/bin/freshcup /
VOLUME /data/conf
CMD ["/freshcup", "-conf", "/data/conf"]