-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.generic_recording_worker
53 lines (42 loc) · 1.45 KB
/
Dockerfile.generic_recording_worker
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
# Start from the latest Ubuntu image
FROM ubuntu:latest
# Avoid prompts from apt-get
ENV DEBIAN_FRONTEND=noninteractive
# Update and install necessary packages
RUN apt-get update && apt-get install -y \
wget \
gnupg \
pulseaudio \
pulseaudio-utils \
ffmpeg \
build-essential \
python3 \
python3-pip \
python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Create a virtual environment
RUN python3 -m venv /app/venv
# Activate the virtual environment and install dependencies
RUN . /app/venv/bin/activate && \
pip3 install --no-cache-dir -r requirements.txt
# Make the bash script executable
RUN chmod +x /app/scripts/generic_recording.sh
# Set environment variable for headless Chrome
ENV CHROME_BIN=/usr/bin/google-chrome-stable
ENV CHROME_PATH=/usr/bin/google-chrome-stable
# Set display port to avoid crash
ENV DISPLAY=:99
# Set the entrypoint script
ENTRYPOINT ["/app/scripts/generic_recording.sh"]