-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (57 loc) · 2.13 KB
/
Dockerfile
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM debian:bullseye
WORKDIR /workspace
RUN apt-get update && apt-get install -y \
curl \
git \
make \
wget \
unzip \
gnupg \
xvfb \
bash \
pulseaudio \
ffmpeg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://golang.org/dl/go1.22.5.linux-amd64.tar.gz \
&& tar -xvf go1.22.5.linux-amd64.tar.gz \
&& mv go /usr/local \
&& rm go1.22.5.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/main cmd/*.go
RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://deb.debian.org/debian bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y chromium chromium-driver
RUN CHROMIUM_PATH=$(which chromium || which chromium-browser) && \
echo "Found chromium at $CHROMIUM_PATH" && \
if [ -z "$CHROMIUM_PATH" ]; then echo "Chromium not found in PATH" && exit 1; fi && \
PATH=$PATH:$(dirname $CHROMIUM_PATH)
RUN FFMPEG_PATH=$(which ffmpeg) && \
echo "Found ffmpeg at $FFMPEG_PATH" && \
if [ -z "$FFMPEG_PATH" ]; then echo "FFmpeg not found in PATH" && exit 1; fi && \
PATH=$PATH:$(dirname $FFMPEG_PATH)
ENV PATH=$PATH
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN chromium --version && \
chromedriver --version && \
ffmpeg -version
# Add pulseaudio as a root user.
RUN adduser root pulse-access
RUN chmod +x pulseaudio.sh
COPY pulseaudio.sh .
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:itsomg' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
EXPOSE 22
EXPOSE 3000
ENTRYPOINT ["./pulseaudio.sh"]
CMD ["/bin/bash"]