-
Notifications
You must be signed in to change notification settings - Fork 124
/
Dockerfile
32 lines (26 loc) · 834 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
28
29
30
31
32
FROM golang:1.18.0-alpine as build
#RUN apk add build-base
RUN apk add git --repository http://mirrors.aliyun.com/alpine/v3.15/main/
RUN apk add libc-dev --repository http://mirrors.aliyun.com/alpine/v3.15/main/
RUN apk add gcc --repository http://mirrors.aliyun.com/alpine/v3.15/main/
ADD . /app
WORKDIR /app
ENV GO111MODULE=on
ENV GOPROXY="https://goproxy.cn,direct"
RUN go mod tidy
RUN go mod download
RUN go build -o server .
FROM alpine
WORKDIR /app
COPY --from=build /app/server /app
COPY ./log4go.xml /app
COPY ./data.db /app
COPY ./html /app/html
LABEL AUTHOR="joinsunsoft"
LABEL LANGUAGE="golang"
LABEL PRODUCT="docker"
LABEL COPYRIGHT="joinsunsoft"
LABEL DECLAIM="All right reserved by joinsunsoft"
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
EXPOSE 8999
ENTRYPOINT ["./server"]