Victor Lacasse-Beaudoin
8bc301f0d5
Seulement passer fichiers source go à build phase Copier contenu/ et static/ à /app/. Copier exécutable et rouler le serveur avec les valeurs par défaut
30 lines
540 B
Docker
30 lines
540 B
Docker
FROM golang:1.20.2 as build
|
|
|
|
LABEL author="Victor Lacasse-Beaudoin <vlbeaudoin@agecem.org>"
|
|
LABEL license="MIT"
|
|
LABEL licensee="AGECEM"
|
|
LABEL repo="https://git.agecem.com/agecem/babillard"
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY go.mod go.sum main.go ./
|
|
|
|
ADD cmd/ cmd/
|
|
|
|
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o babillard .
|
|
|
|
# Alpine
|
|
|
|
FROM alpine:3.17.2
|
|
|
|
RUN apk update && apk upgrade --no-cache
|
|
|
|
WORKDIR /app
|
|
|
|
ADD contenu/ contenu/
|
|
|
|
ADD static/ static/
|
|
|
|
COPY --from=build /go/src/app/babillard /usr/bin/babillard
|
|
|
|
CMD ["babillard", "server"]
|