2023-01-04 23:15:12 +01:00
|
|
|
|
# IMPORTANT: This Dockerfile has been provided for the sake of convenience.
|
|
|
|
|
# Currently, functionality of the containers built based on this file
|
|
|
|
|
# is not a part of our continuous testing. Although, patches to keep it
|
|
|
|
|
# up to date are always welcome.
|
|
|
|
|
#
|
|
|
|
|
# See ‘Earthfile’ for the recipes used in official builds.
|
|
|
|
|
|
2021-05-22 03:18:42 +02:00
|
|
|
|
FROM golang:alpine AS build
|
2023-01-04 23:15:12 +01:00
|
|
|
|
|
2022-03-17 00:24:04 -07:00
|
|
|
|
RUN apk update && apk add --no-cache git gcc build-base linux-headers
|
2021-06-17 21:27:17 -05:00
|
|
|
|
|
2023-01-04 23:15:12 +01:00
|
|
|
|
WORKDIR /build
|
|
|
|
|
COPY . /build
|
|
|
|
|
|
2021-06-17 21:27:17 -05:00
|
|
|
|
ARG VERSION=dev
|
|
|
|
|
ENV VERSION=${VERSION}
|
|
|
|
|
ARG GIT_COMMIT
|
|
|
|
|
ENV GIT_COMMIT=${GIT_COMMIT}
|
|
|
|
|
ARG NAME=docker
|
|
|
|
|
ENV NAME=${NAME}
|
2021-05-22 03:18:42 +02:00
|
|
|
|
|
2021-06-28 16:01:01 -07: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 03:18:42 +02:00
|
|
|
|
|
2021-06-17 21:27:17 -05:00
|
|
|
|
# Create the image by copying the result of the build into a new alpine image
|
2024-05-22 22:11:57 +00:00
|
|
|
|
FROM alpine:3.20.0
|
2021-06-17 21:27:17 -05:00
|
|
|
|
RUN apk update && apk add --no-cache ffmpeg ffmpeg-libs ca-certificates && update-ca-certificates
|
2021-05-22 03:18:42 +02:00
|
|
|
|
|
2023-01-04 23:15:12 +01:00
|
|
|
|
RUN addgroup -g 101 -S owncast && adduser -u 101 -S owncast -G owncast
|
|
|
|
|
|
2021-06-17 21:27:17 -05:00
|
|
|
|
# Copy owncast assets
|
2020-06-09 18:28:07 -07:00
|
|
|
|
WORKDIR /app
|
2021-05-22 03:18:42 +02:00
|
|
|
|
COPY --from=build /build/owncast /app/owncast
|
2021-06-17 21:27:17 -05:00
|
|
|
|
RUN mkdir /app/data
|
2023-01-04 23:15:12 +01:00
|
|
|
|
RUN chown -R owncast:owncast /app
|
|
|
|
|
USER owncast
|
2022-04-15 16:56:12 -04:00
|
|
|
|
ENTRYPOINT ["/app/owncast"]
|
2021-10-13 05:31:58 +11:00
|
|
|
|
EXPOSE 8080 1935
|