forked from attendee-labs/attendee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prod
More file actions
101 lines (84 loc) · 3.19 KB
/
Copy pathDockerfile.prod
File metadata and controls
101 lines (84 loc) · 3.19 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Stage 1: Base system and system dependencies
FROM ubuntu:22.04 AS system-deps
SHELL ["/bin/bash", "-c"]
ENV project=attendee
ENV cwd=/$project
WORKDIR $cwd
ARG DEBIAN_FRONTEND=noninteractive
# Install core build tools and essential libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
gdb \
git \
gfortran \
libdbus-1-3 \
libgbm1 \
libgl1-mesa-glx \
libglib2.0-0 \
libglib2.0-dev \
libssl-dev \
libx11-dev \
libx11-xcb1 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-shape0 \
libxcb-shm0 \
libxcb-xfixes0 \
libxcb-xtest0 \
libgl1-mesa-dri \
libxfixes3 \
linux-libc-dev \
pkgconf \
tar \
unzip \
zip \
vim \
libpq-dev \
# Chrome dependencies
xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps libvulkan1 fonts-liberation xdg-utils \
# ALSA & Pulseaudio
libasound2 libasound2-plugins alsa alsa-utils alsa-oss \
pulseaudio pulseaudio-utils ffmpeg \
# GStreamer
gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgirepository1.0-dev \
# Other tools
universal-ctags \
xterm \
&& rm -rf /var/lib/apt/lists/*
# Install Chrome. Using curl and dpkg -i for cleaner installation.
RUN curl -sS -o google-chrome-stable.deb http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_134.0.6998.88-1_amd64.deb \
&& apt-get install -y ./google-chrome-stable.deb \
&& rm google-chrome-stable.deb
# Alias python3 to python (ensure python3 is already installed or install it first if needed)
RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/python3 /usr/bin/python
# Stage 2: Install Python dependencies
FROM system-deps AS python-deps
# Copy only requirements.txt first to leverage Docker cache
COPY requirements.txt .
# Ensure gunicorn is in your requirements.txt
RUN pip install --no-cache-dir -r requirements.txt \
# Install specific python dependencies if not in requirements.txt (prefer requirements.txt)
# pip install pyjwt cython gdown deepgram-sdk python-dotenv
# Pre-populate the cache for tldextract
RUN python -c "import tldextract; tldextract.extract('google.com')"
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# Stage 3: Copy application code and set up entrypoint
FROM python-deps AS final
WORKDIR $cwd
COPY . .
# Ensure this path is correct relative to $cwd or /opt as per your original.
# If your entrypoint.sh is in the root of your project, use:
COPY entrypoint.sh /opt/bin/entrypoint.sh
RUN chmod +x /opt/bin/entrypoint.sh
RUN adduser root pulse-access # This might need to be run AFTER pulseaudio is installed, which it is.
# Set the entrypoint to tini, and tini will execute your entrypoint.sh
ENTRYPOINT ["/tini", "--"]
# CMD is now handled by your entrypoint.sh, which will call Gunicorn
CMD ["/opt/bin/entrypoint.sh"]