Dockerfile at al

main
Uriel Fanelli 2025-09-28 16:01:23 +02:00
parent 157d0614da
commit 51bfa9a300
1 changed files with 4 additions and 7 deletions

View File

@ -1,17 +1,14 @@
# ====== STAGE 1: build ======
FROM golang:1.22-alpine AS builder
FROM golang:latest AS builder
# Installa tool utili per mod e certs (git, ca)
RUN apk add --no-cache git ca-certificates
RUN apt install git ca-certificates -y
WORKDIR /src
# Copia i mod per cache dei deps
COPY go.mod go.sum ./
RUN go mod download
# Copia il resto del sorgente
COPY . .
RUN go mod tidy ; go mod vendor
# Compila binario statico e snello
ENV CGO_ENABLED=0