2023-01-05 01:15:12 +03: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 04:18:42 +03:00
|
|
|
|
FROM golang:alpine AS build
|
2023-01-05 01:15:12 +03:00
|
|
|
|
|
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
|
|
|
|
|
2023-01-05 01:15:12 +03:00
|
|
|
|
WORKDIR /build
|
|
|
|
|
COPY . /build
|
|
|
|
|
|
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
|
2024-09-07 01:59:41 +03:00
|
|
|
|
FROM alpine:3.20.3
|
2021-06-18 05:27:17 +03:00
|
|
|
|
RUN apk update && apk add --no-cache ffmpeg ffmpeg-libs ca-certificates && update-ca-certificates
|
2021-05-22 04:18:42 +03:00
|
|
|
|
|
2023-01-05 01:15:12 +03:00
|
|
|
|
RUN addgroup -g 101 -S owncast && adduser -u 101 -S owncast -G owncast
|
|
|
|
|
|
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
|
|
|
|
RUN mkdir /app/data
|
2023-01-05 01:15:12 +03:00
|
|
|
|
RUN chown -R owncast:owncast /app
|
|
|
|
|
USER owncast
|
2022-04-15 23:56:12 +03:00
|
|
|
|
ENTRYPOINT ["/app/owncast"]
|
2021-10-12 21:31:58 +03:00
|
|
|
|
EXPOSE 8080 1935
|