一些常用DockerFile和docker-compose.yml文件
一些常用DockerFile和docker-compose.yml文件 go-zero中的配置用在gin框架中 Dockerfile FROM golang:alpine AS builder LABEL stage=gobuilder ENV CGO_ENABLED 0 ENV GOPROXY https://goproxy.cn,direct RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories RUN apk update --no-cache && apk add --no-cache tzdata WORKDIR /build ADD go.mod . ADD go.sum . RUN go mod download COPY . . COPY etc/env.yaml /app/etc/env.yaml RUN go build -ldflags="-s -w" -o /app/{项目名称} main.go FROM scratch COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai ENV TZ Asia/Shanghai WORKDIR /app COPY --from=builder /app/{项目名称} /app/{项目名称} COPY --from=builder /app/etc/env....