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 08:24:04 +01:00
|
|
|
|
RUN apk update && apk add --no-cache git gcc build-base linux-headers
|
2021-06-18 04:27:17 +02:00
|
|
|
|
|
2023-01-04 23:15:12 +01:00
|
|
|
|
WORKDIR /build
|
|
|
|
|
COPY . /build
|
|
|
|
|
|
2021-06-18 04:27:17 +02: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-29 01:01:01 +02: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-18 04:27:17 +02:00
|
|
|
|
# Create the image by copying the result of the build into a new alpine image
|
2023-05-10 06:14:46 +02:00
|
|
|
|
FROM alpine:3.18.0
|
2021-06-18 04:27:17 +02: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-18 04:27:17 +02:00
|
|
|
|
# Copy owncast assets
|
2020-06-10 03:28:07 +02:00
|
|
|
|
WORKDIR /app
|
2021-05-22 03:18:42 +02:00
|
|
|
|
COPY --from=build /build/owncast /app/owncast
|
2021-06-18 04:27:17 +02:00
|
|
|
|
RUN mkdir /app/data
|
2023-01-04 23:15:12 +01:00
|
|
|
|
RUN chown -R owncast:owncast /app
|
|
|
|
|
USER owncast
|
2022-04-15 22:56:12 +02:00
|
|
|
|
ENTRYPOINT ["/app/owncast"]
|
2021-10-12 20:31:58 +02:00
|
|
|
|
EXPOSE 8080 1935
|