Files
History_Api/Dockerfile
AzenKain 9bc2200455
Some checks failed
Build and Release / release (push) Failing after 1m32s
init
2026-03-25 22:37:54 +07:00

29 lines
475 B
Docker

FROM golang:1.26.1-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build -trimpath -ldflags="-s -w" -o history-api ./cmd/history-api
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
ENV TZ=Asia/Ho_Chi_Minh
WORKDIR /app
COPY --from=builder /app/history-api .
COPY data ./data
RUN chmod +x ./history-api
EXPOSE 3344
CMD ["./history-api"]