1
0
Fork 0
This repository has been archived on 2025-09-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-yggdrasil/build/package/httpserver/Dockerfile

31 lines
575 B
Docker

# 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-httpserver ./cmd/httpserver
FROM alpine:${ALPINE_VERSION} AS runtime
WORKDIR /srv
RUN apk add --no-cache ca-certificates
COPY --from=builder /build/api ./api
COPY --from=builder /build/yggdrasil-httpserver .
CMD ["/srv/yggdrasil-httpserver"]