Ajouter multistage build docker
Valeurs par défaut devraient fonctionner pour évaluer l'application hors-production
This commit is contained in:
parent
e585b65565
commit
7aca281a3c
2 changed files with 70 additions and 16 deletions
35
v4/Dockerfile
Normal file
35
v4/Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
|||
FROM golang:1.20.2 as build
|
||||
|
||||
LABEL author="vlbeaudoin"
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
COPY go.mod go.sum main.go ./
|
||||
|
||||
ADD cmd/ cmd/
|
||||
ADD data/ data/
|
||||
ADD handlers/ handlers/
|
||||
ADD models/ models/
|
||||
ADD web/ web/
|
||||
|
||||
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o bottin .
|
||||
|
||||
# Alpine
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /go/src/app/bottin /usr/bin/bottin
|
||||
|
||||
CMD ["bottin", "--help"]
|
||||
|
||||
# Debian
|
||||
|
||||
#FROM debian:stable-20230502
|
||||
|
||||
#WORKDIR /app
|
||||
|
||||
#COPY --from=build /go/src/app/haul /usr/bin/haul
|
||||
|
||||
#CMD ["haul", "--help"]
|
Reference in a new issue