2021-06-18 05:27:17 +03:00
|
|
|
# Perform a build
|
2021-05-22 04:18:42 +03:00
|
|
|
FROM golang:alpine AS build
|
2021-06-18 05:27:17 +03:00
|
|
|
RUN mkdir /build
|
|
|
|
ADD . /build
|
2021-05-22 04:18:42 +03:00
|
|
|
WORKDIR /build
|
2022-03-17 10:24:04 +03:00
|
|
|
RUN apk update && apk add --no-cache git gcc build-base linux-headers
|
2021-06-18 05:27:17 +03:00
|
|
|
|
|
|
|
ARG VERSION=dev
|
|
|
|
ENV VERSION=${VERSION}
|
|
|
|
ARG GIT_COMMIT
|
|
|
|
ENV GIT_COMMIT=${GIT_COMMIT}
|
|
|
|
ARG NAME=docker
|
|
|
|
ENV NAME=${NAME}
|
2021-05-22 04:18:42 +03:00
|
|
|
|
2021-06-29 02:01:01 +03:00
|
|
|
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -ldflags "-extldflags \"-static\" -s -w -X github.com/owncast/owncast/config.GitCommit=$GIT_COMMIT -X github.com/owncast/owncast/config.VersionNumber=$VERSION -X github.com/owncast/owncast/config.BuildPlatform=$NAME" -o owncast .
|
2021-05-22 04:18:42 +03:00
|
|
|
|
2021-06-18 05:27:17 +03:00
|
|
|
# Create the image by copying the result of the build into a new alpine image
|
2021-05-22 04:18:42 +03:00
|
|
|
FROM alpine
|
2022-10-01 19:54:04 +03:00
|
|
|
RUN apk update && apk add --no-cache ffmpeg ffmpeg-libs libva-intel-driver mesa-va-gallium mesa-vdpau-gallium intel-media-driver libva-vdpau-driver ca-certificates && update-ca-certificates
|
2021-05-22 04:18:42 +03:00
|
|
|
|
2021-06-18 05:27:17 +03:00
|
|
|
# Copy owncast assets
|
2020-06-10 04:28:07 +03:00
|
|
|
WORKDIR /app
|
2021-05-22 04:18:42 +03:00
|
|
|
COPY --from=build /build/owncast /app/owncast
|
2021-06-18 05:27:17 +03:00
|
|
|
COPY --from=build /build/webroot /app/webroot
|
|
|
|
RUN mkdir /app/data
|
2022-04-15 23:56:12 +03:00
|
|
|
ENTRYPOINT ["/app/owncast"]
|
2021-10-12 21:31:58 +03:00
|
|
|
EXPOSE 8080 1935
|