-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (44 loc) · 1.64 KB
/
Dockerfile
File metadata and controls
53 lines (44 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Setup base
FROM golang:1.25.0 AS base
WORKDIR /app
COPY ./go.mod ./
COPY ./go.sum ./
RUN go mod download
COPY cmd/ ./cmd/
COPY twitch/ ./twitch/
COPY utils/ ./utils/
# Setup builder
FROM base AS builder
RUN go build -o /stream ./cmd/main.go
# Download Chrome in a separate stage so it's done parallel to the rest of the build
FROM curlimages/curl:latest AS downloader
RUN curl -fsSL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
-o google-chrome-stable_current_amd64.deb
# Run using FFmpeg image with Chrome support
FROM linuxserver/ffmpeg:7.1.1 AS runner
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
xvfb \
x11-utils \
pulseaudio \
pulseaudio-utils \
alsa-utils \
libasound2-plugins \
dbus \
&& rm -rf /var/lib/apt/lists/*
# Install Chrome from downloaded .deb
COPY --from=downloader /home/curl_user/google-chrome-stable_current_amd64.deb /tmp/google-chrome-stable_current_amd64.deb
RUN apt-get update \
&& apt-get install -y /tmp/google-chrome-stable_current_amd64.deb \
&& rm /tmp/google-chrome-stable_current_amd64.deb \
&& rm -rf /var/lib/apt/lists/*
# Create directories for audio configs
RUN mkdir -p /root/.config/pulse /var/run/pulse /var/run/dbus
# Copy startup script
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Copy app binary
COPY --from=builder /stream /stream
# Set environment variables (DISPLAY will be set dynamically in start.sh)
ENV PULSE_RUNTIME_PATH=/var/run/pulse
ENTRYPOINT ["/start.sh"]