1
0
Fork 0

build: move Dockerfile for httpserver to build/ dir

This commit is contained in:
Vojtěch Mareš 2024-06-23 13:30:06 +02:00
parent 4814883454
commit 4c7f1c2aec
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D

View file

@ -0,0 +1,30 @@
# syntax=docker/dockerfile:1
ARG ALPINE_VERSION=3.19
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine${ALPINE_VERSION} AS builder
ARG BUILDPLATFORM
WORKDIR /build
COPY ../../../go.mod go.sum ./
RUN go mod download
COPY ../../.. .
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o yggdrasil ./cmd/yggdrasil
FROM alpine:${ALPINE_VERSION} AS runtime
WORKDIR /srv
RUN apk add --no-cache ca-certificates
COPY --from=builder /build/yggdrasil .
CMD ["/srv/yggdrasil"]