Skip to content

Commit

Permalink
Docker: Scanner: Move to alpine to get a newer ffmpeg version
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthi-chaud committed Dec 25, 2024
1 parent d011e3f commit 8ee4de8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scanner/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 8ee4de8

Please sign in to comment.