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

20 lines
739 B
Docker
Raw Normal View History

2020-09-27 18:25:42 +00:00
# Install dependencies, build libsrt then build ghostream
2020-09-21 15:29:50 +00:00
FROM golang:1.15-alpine AS build_base
2020-09-27 18:25:42 +00:00
RUN apk add --no-cache git build-base tcl pkgconfig cmake libressl-dev linux-headers
RUN git clone --depth 1 --branch v1.4.2 https://github.com/Haivision/srt && \
cd srt && ./configure --enable-apps=OFF && make install && cd .. && rm -rf srt
2020-09-21 15:29:50 +00:00
WORKDIR /code
2020-09-27 19:26:06 +00:00
COPY go.* ./
2020-09-21 15:29:50 +00:00
RUN go mod download
2020-09-27 19:26:06 +00:00
COPY . .
RUN go build -ldflags '-extldflags "-static"' -o ./out/ghostream .
2020-09-21 15:29:50 +00:00
# Production image
FROM alpine:3.12
RUN apk add ca-certificates
COPY --from=build_base /code/out/ghostream /app/ghostream
2020-09-27 18:25:42 +00:00
COPY --from=build_base /code/web/static /app/web/static
COPY --from=build_base /code/web/template /app/web/template
2020-09-21 15:29:50 +00:00
EXPOSE 8080
2020-09-27 18:25:42 +00:00
CMD ["/app/ghostream"]