Update Dockerfile

This commit is contained in:
izaac49 2026-02-12 21:18:31 +07:00 committed by GitHub
parent 9ce41ec96e
commit 5b546d1423
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,15 @@
FROM golang:1.25.7 FROM golang:1.25.7
WORKDIR /app WORKDIR /app
# Copy go.mod and go.sum first (better caching)
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source code
COPY . . COPY . .
RUN go build -tags netgo -ldflags "-s -w" -o app # Build the app (assuming main.go is in the root)
RUN go build -tags netgo -ldflags "-s -w" -o app ./...
CMD ["./app"] CMD ["./app"]