Dockerfile at al
parent
157d0614da
commit
51bfa9a300
11
Dockerfile
11
Dockerfile
|
@ -1,17 +1,14 @@
|
||||||
# ====== STAGE 1: build ======
|
# ====== STAGE 1: build ======
|
||||||
FROM golang:1.22-alpine AS builder
|
FROM golang:latest AS builder
|
||||||
|
|
||||||
# Installa tool utili per mod e certs (git, ca)
|
# 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
|
WORKDIR /src
|
||||||
|
|
||||||
# Copia i mod per cache dei deps
|
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
|
|
||||||
# Copia il resto del sorgente
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN go mod tidy ; go mod vendor
|
||||||
|
|
||||||
|
|
||||||
# Compila binario statico e snello
|
# Compila binario statico e snello
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
|
|
Loading…
Reference in New Issue