Update Dockerfile
This commit is contained in:
parent
5b546d1423
commit
2f5421fa41
1 changed files with 9 additions and 4 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -1,15 +1,20 @@
|
||||||
FROM golang:1.25.7
|
# Build stage
|
||||||
|
FROM golang:1.25.7 AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy go.mod and go.sum first (better caching)
|
# Copy go.mod and go.sum first for dependency caching
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
# Copy the rest of the source code
|
# Copy the rest of the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the app (assuming main.go is in the root)
|
# Build the binary from cmd/picoclaw
|
||||||
RUN go build -tags netgo -ldflags "-s -w" -o app ./...
|
RUN go build -tags netgo -ldflags "-s -w" -o app ./cmd/picoclaw
|
||||||
|
|
||||||
|
# Final stage: minimal runtime image
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/app .
|
||||||
CMD ["./app"]
|
CMD ["./app"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue