Initial commit

This commit is contained in:
2025-10-19 15:47:39 +10:30
commit 49bf9370b0
5 changed files with 305 additions and 0 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM --platform=$BUILDPLATFORM golang:1.25 AS build-stage
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
WORKDIR /app
COPY go.mod ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /plexbrainz
# Run the tests in the container
FROM build-stage AS run-test-stage
RUN go test -v ./...
# Deploy the application binary into a lean image
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /plexbrainz /plexbrainz
EXPOSE 1973
USER nonroot:nonroot
ENTRYPOINT ["/plexbrainz"]