-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (26 loc) · 981 Bytes
/
Dockerfile
File metadata and controls
28 lines (26 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# syntax=docker/dockerfile:1.4
ARG GOVERSION=1.22
ARG BASE=busybox # for wget healtcheck
FROM --platform=${BUILDPLATFORM} golang:${GOVERSION} AS build
# These two are automatically set by docker buildx
ARG TARGETARCH
ARG TARGETOS
WORKDIR /src
COPY --link go.mod go.sum* ./
ARG GOPRIVATE=github.com/lionello/nounly-go
RUN go mod download
ARG GOSRC=.
COPY --link ${GOSRC} ./
# RUN go test -v ./... FIXME: "no required module provides package github.com/defang-io/defang-mvp/fabric/internal/util_test"
ARG BUILD=./cmd/server
ARG VERSION
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -buildvcs=false -ldflags="-w -s -X \"main.version=${VERSION}\"" -o /server "${BUILD}"
FROM --platform=${TARGETPLATFORM} ${BASE}
# RUN apk add --update curl ca-certificates && rm -rf /var/cache/apk* # Certificates for SSL
ARG PORT=80
ENV PORT=$PORT
COPY --link --from=build /server /server
COPY --link ./public /public
ENTRYPOINT [ "/server" ]
EXPOSE $PORT
# USER nobody