38 lines
718 B
Docker
38 lines
718 B
Docker
FROM golang:1.26.0 AS builder
|
|
|
|
RUN go env -w GO111MODULE=on
|
|
RUN go env -w GOPROXY=https://goproxy.cn,direct
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
COPY common ./common
|
|
|
|
RUN sed -i 's|replace gitea.com/red-future/common => ../common|replace gitea.com/red-future/common => ./common|' go.mod
|
|
|
|
RUN go mod download && go mod verify
|
|
|
|
COPY . .
|
|
|
|
RUN go mod tidy
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -v -o report-engine .
|
|
|
|
FROM alpine:latest
|
|
|
|
ENV TIME_ZONE=Asia/Seoul
|
|
RUN apk add --no-cache tzdata ca-certificates && \
|
|
ln -sf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /build/report-engine .
|
|
COPY config.yml .
|
|
|
|
RUN mkdir -p resource/log/server
|
|
|
|
EXPOSE 3001
|
|
|
|
CMD ["./report-engine"]
|