18 lines
708 B
Docker
18 lines
708 B
Docker
# Install dependencies then build ghostream
|
|
FROM golang:1.15-alpine AS build_base
|
|
RUN apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/community/ gcc libsrt-dev musl-dev
|
|
WORKDIR /code
|
|
COPY go.* ./
|
|
RUN go mod download && go get github.com/markbates/pkger/cmd/pkger
|
|
COPY . .
|
|
RUN go generate && go build -o ./out/ghostream .
|
|
|
|
# Production image
|
|
FROM alpine:3.12
|
|
RUN apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/community/ ffmpeg libsrt
|
|
COPY --from=build_base /code/out/ghostream /app/ghostream
|
|
WORKDIR /app
|
|
# 9710 for SRT, 8080 for Web, 2112 for monitoring, 10000-10005 (UDP) for WebRTC and 23 for telnet
|
|
EXPOSE 9710/udp 8080 2112 10000-10005/udp 8023
|
|
CMD ["/app/ghostream"]
|