forked from XanderStrike/goplaxt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 761 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 761 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
29
30
31
32
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
RUN echo "Building for $TARGETOS / $TARGETARCH / $TARGETVARIANT"
WORKDIR $GOPATH/src/github.com/viscerous/goplaxt/
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN mkdir -p /out/keystore
RUN CGO_ENABLED=0 \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH \
GOARM=$(echo $TARGETVARIANT | sed 's/v//') \
go build -o /out/goplaxt-docker .
FROM scratch
LABEL maintainer="rviscerous@gmail.com"
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /out .
COPY static ./static
VOLUME /app/keystore/
EXPOSE 8000
ENTRYPOINT ["/app/goplaxt-docker"]