forked from gabe565/CastSponsorSkip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 690 Bytes
/
Dockerfile
File metadata and controls
34 lines (23 loc) · 690 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
33
34
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.24.0-alpine AS go-builder
WORKDIR /app
COPY --from=xx / /
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
COPY cmd/ cmd/
COPY internal/ internal/
ARG TARGETPLATFORM
RUN --mount=type=cache,target=/root/.cache \
CGO_ENABLED=0 xx-go build -ldflags="-w -s" -trimpath -tags grpcnotrace
FROM alpine:3.21.3
WORKDIR /app
RUN apk add --no-cache tzdata
ARG USERNAME=castsponsorskip
ARG UID=1000
ARG GID=$UID
RUN addgroup -g "$GID" "$USERNAME" \
&& adduser -S -u "$UID" -G "$USERNAME" "$USERNAME"
COPY --from=go-builder /app/castsponsorskip ./
USER $UID
CMD ["./castsponsorskip"]