agecem-org/Dockerfile
Victor Lacasse-Beaudoin 6c97a670c6 Ajouter version subcommand
Affiche la version de l'exécutable tel que défini at build time.

Autres changements:
- [DOCKERFILE] Ajouter `ARG agecem_org_version`
- [FEATURE] Ajouter package version/
- [DOCKERFILE] `ADD version/`
- [DOCKERFILE] Retirer installsuffix de build step
- [DOCKERFILE] Utiliser `agecem_org_version` pour remplir version.version dans
  l'exécutabe
- [DOCKERFILE] Nommer deuxième stage `run`
- [DOCKER-COMPOSE] Standardiser valeurs
2023-11-13 16:49:20 -05:00

43 lines
719 B
Docker

FROM golang:1.21.1 AS build
ARG agecem_org_version
LABEL author="Victor Lacasse-Beaudoin <vlbeaudoin@agecem.org>"
WORKDIR /go/src/app
COPY go.mod go.sum main.go ./
ADD public/ public/
ADD cmd/ cmd/
ADD api/ api/
ADD api_handlers/ api_handlers/
ADD apiresponse/ apiresponse/
ADD config/ config/
ADD media/ media/
ADD models/ models/
ADD templates/ templates/
ADD version/ version/
ADD web_handlers/ web_handlers/
Add webresponse/ webresponse/
RUN CGO_ENABLED=0 go build -a -o agecem-org -ldflags="-X 'git.agecem.com/agecem/agecem-org/version.version=$agecem_org_version'" .
# Alpine
FROM alpine:3.18.3 AS run
COPY --from=build /go/src/app/agecem-org /usr/bin/agecem-org
CMD ["agecem-org", "server"]