1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-23 00:22:19 +00:00

Build the docker image over Debian Bullseye since Alpine FFMPEG is not built with libsrt yet

This commit is contained in:
Yohann D'ANELLO 2020-09-30 19:28:08 +02:00
parent f455950865
commit 3c21f744e8

View File

@ -1,20 +1,20 @@
# Install dependencies then build ghostream # Install dependencies then build ghostream
FROM golang:1.15-alpine AS build_base FROM debian:bullseye-slim AS build_base
RUN apk add --no-cache gcc musl-dev RUN apt-get update && \
# libsrt is not yet packaged in community repository apt-get install -y --no-install-recommends ca-certificates \
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt-dev gcc golang libc6-dev libsrt1 libsrt-openssl-dev musl-dev
WORKDIR /code WORKDIR /code
COPY go.* ./ COPY go.* ./
RUN go mod download && go get github.com/markbates/pkger/cmd/pkger RUN go mod download && go get github.com/markbates/pkger/cmd/pkger
COPY . . # Don't copy all to save time each time we touch a non-code file
RUN go generate && go build -o ./out/ghostream . COPY auth/ internal/ stream/ web/ go.mod go.sum main.go ./
RUN PATH=/root/go/bin:$PATH go generate && go build -o ./out/ghostream .
# Production image # Production image
FROM alpine:3.12 FROM debian:bullseye-slim
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt RUN apt-get update && apt-get install -y ffmpeg libsrt1 musl
RUN apk add ffmpeg
COPY --from=build_base /code/out/ghostream /app/ghostream COPY --from=build_base /code/out/ghostream /app/ghostream
WORKDIR /app WORKDIR /app
# 9710 for SRT, 8080 for Web, 2112 for monitoring and 10000-10005 (UDP) for WebRTC # 9710 (UDP) for SRT, 8080 for Web, 2112 for monitoring and 10000-10005 (UDP) for WebRTC
EXPOSE 9710/udp 8080 2112 10000-10005/udp EXPOSE 9710/udp 8080 2112 10000-10005/udp
CMD ["/app/ghostream"] CMD ["/app/ghostream"]