Use a multistage build for the docker transcoder

This commit is contained in:
Zoe Roux 2024-01-18 13:27:54 +01:00
parent 7309a435c5
commit f1c3844bd3

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 RUN apk add --no-cache build-base ffmpeg libmediainfo-dev
WORKDIR /app WORKDIR /app
COPY go.mod go.sum ./ COPY go.mod go.sum ./
@ -6,5 +6,10 @@ RUN go mod download
COPY . . COPY . .
RUN go build -o ./transcoder 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 EXPOSE 7666
CMD ./transcoder CMD ./transcoder