Use a multistage build for the docker transcoder

This commit is contained in:
2024-01-18 13:27:54 +01:00
parent 7309a435c5
commit f1c3844bd3
+6 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine
FROM golang:1.21-alpine as build
RUN apk add --no-cache build-base ffmpeg libmediainfo-dev
WORKDIR /app
COPY go.mod go.sum ./
@@ -6,5 +6,10 @@ RUN go mod download
COPY . .
RUN go build -o ./transcoder
FROM alpine
RUN apk add --no-cache build-base ffmpeg libmediainfo-dev
WORKDIR /app
COPY --from=build /app/transcoder /app/transcoder
EXPOSE 7666
CMD ./transcoder