Prepara versao dev 1.0
This commit is contained in:
@@ -3,15 +3,18 @@ FROM golang:1.23-alpine AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Copy go.mod and go.sum from cmd/server
|
||||
COPY cmd/server/go.mod cmd/server/go.sum ./
|
||||
RUN go mod download
|
||||
# Copy go module files
|
||||
COPY go.mod ./
|
||||
RUN test -f go.sum && cp go.sum go.sum.bak || true
|
||||
|
||||
# Copy source code
|
||||
COPY cmd/server/main.go ./
|
||||
# Copy entire source tree (internal/, cmd/)
|
||||
COPY . .
|
||||
|
||||
# Build
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .
|
||||
# Ensure go.sum is up to date
|
||||
RUN go mod tidy
|
||||
|
||||
# Build from root (module is defined there)
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server ./cmd/server
|
||||
|
||||
# Runtime image
|
||||
FROM alpine:latest
|
||||
|
||||
Reference in New Issue
Block a user