live-streamer/Dockerfile

27 lines
574 B
Docker
Raw Normal View History

2024-10-29 05:11:14 -04:00
FROM golang:1.23 AS builder
2024-10-28 04:07:56 -04:00
LABEL authors="nite07"
WORKDIR /app
COPY . .
RUN go mod download
ARG version
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X live-streamer/constant.Version=${version}" -o live-streamer .
FROM alpine:latest
2024-10-29 05:11:14 -04:00
WORKDIR /app
RUN apk update && \
apk add --no-cache \
ffmpeg \
fontconfig \
ttf-dejavu \
ttf-liberation \
font-noto \
font-noto-emoji \
wqy-zenhei \
&& fc-cache -f
2024-10-28 04:07:56 -04:00
COPY --from=builder /app/live-streamer /app/live-streamer
EXPOSE 8080
VOLUME [ "/app/config.json" ]
CMD ["/app/live-streamer"]