Update Dockerfile
This commit is contained in:
parent
9ce41ec96e
commit
5b546d1423
1 changed files with 8 additions and 1 deletions
|
|
@ -1,8 +1,15 @@
|
|||
FROM golang:1.25.7
|
||||
|
||||
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 . .
|
||||
|
||||
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"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue