Files
media/Dockerfile

25 lines
437 B
Docker
Raw Permalink Normal View History

2026-05-19 14:33:06 +08:00
# 阶段1: 构建
2026-06-10 16:10:10 +08:00
FROM golang:alpine AS builder
2026-05-19 14:33:06 +08:00
RUN apk add --no-cache git ca-certificates tzdata
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0
ENV GOTOOLCHAIN=auto
WORKDIR /build
COPY . .
RUN go mod download && go mod tidy
RUN go build -ldflags="-s -w" -o main ./main.go
2026-05-20 11:39:01 +08:00
EXPOSE 3010
2026-05-19 14:33:06 +08:00
CMD ["./main"]