krz/skunky-art

Alternative privacy frontend for DeviantArt.

clone: git clone https://gitbay.org/krz/skunky-art.git

sonarcloud-cleanup: Dockerfile · raw

 1ARG GO_VERSION=1.25
 2
 3FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build
 4ARG TARGETOS
 5ARG TARGETARCH
 6# Set by the release workflow from the git tag; --help and /api/instance report it.
 7ARG VERSION=dev
 8
 9WORKDIR /build
10COPY . .
11RUN CGO_ENABLED=0 GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" \
12  go build -ldflags "-s -w -extldflags '-static' -X main.version=${VERSION}" && \
13  echo "skunkyart:x:10000:10000:SkunkyArt user:/:/sbin/nologin" > /etc/minimal-passwd && \
14  echo "skunkyart:x:10000:" > /etc/minimal-group
15
16FROM scratch
17
18COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
19COPY --from=build /build/static /static
20COPY --from=build /build/skunkyart /skunkyart
21COPY --from=build /etc/minimal-passwd /etc/passwd
22COPY --from=build /etc/minimal-group /etc/group
23
24USER skunkyart
25
26ENTRYPOINT ["/skunkyart"]