diff --git a/scanner/Dockerfile b/scanner/Dockerfile index 5aa3ffa9..d16c663c 100644 --- a/scanner/Dockerfile +++ b/scanner/Dockerfile @@ -1,6 +1,5 @@ -FROM golang:1.22.6-bullseye AS builder +FROM golang:1.22.6-alpine AS builder RUN go install github.com/swaggo/swag/cmd/swag@latest -RUN apt-get update -y; apt-get install -y ffmpeg WORKDIR /app COPY go.mod go.sum ./ RUN go mod download @@ -9,12 +8,12 @@ COPY ./internal ./internal RUN swag init -d app -o ./app/docs RUN GOOS=linux go build -o ./scanner ./app -FROM debian:bullseye-slim AS runner +FROM golang:1.22.6-alpine AS runner ENV SERVICE_NAME="scanner" -RUN useradd -ms /bin/false $SERVICE_NAME +RUN adduser --disabled-password -s /bin/false $SERVICE_NAME -RUN apt-get update -y; apt-get install -y ffmpeg wget libchromaprint-tools libchromaprint-dev libfftw3-dev +RUN apk update && apk upgrade && apk add ffmpeg chromaprint mailcap WORKDIR /app COPY --from=builder /app/scanner ./ USER $SERVICE_NAME diff --git a/scanner/Dockerfile.dev b/scanner/Dockerfile.dev index 787de85a..3f254dbe 100644 --- a/scanner/Dockerfile.dev +++ b/scanner/Dockerfile.dev @@ -1,7 +1,8 @@ -FROM golang:1.22.6-bullseye +FROM golang:1.22.6-alpine RUN go install github.com/bokwoon95/wgo@latest RUN go install github.com/swaggo/swag/cmd/swag@latest -RUN apt-get update -y; apt-get install -y ffmpeg libchromaprint-tools libchromaprint-dev libfftw3-dev + +RUN apk update && apk upgrade && apk add ffmpeg chromaprint mailcap WORKDIR /app CMD ["wgo", "-xdir", "./app/docs", "swag", "init", "-d", "app", "-o", "./app/docs", "::", "go", "run", "./app"]