forked from cxz66666/zju-ical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (24 loc) · 869 Bytes
/
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
FROM golang:1.21-bullseye
EXPOSE 5678
WORKDIR /workspace
RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list \
&& sed -i s/security.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list \
&& apt-get update -y&& apt-get upgrade -y && apt-get install -y make
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
WORKDIR /app
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
RUN go mod tidy
# src code
COPY . .
RUN make zjuicalsrv-linux-amd64
RUN mv build/zjuicalsrv-linux-amd64 ./zjuicalsrv
RUN chmod +x ./zjuicalsrv
ENV TZ=Asia/Shanghai
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
ENTRYPOINT ["./zjuicalsrv"]