-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.worker
More file actions
102 lines (84 loc) · 2.49 KB
/
Dockerfile.worker
File metadata and controls
102 lines (84 loc) · 2.49 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
102
FROM node:22-slim AS node-base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
libpixman-1-dev \
libxi-dev \
libgl1-mesa-dev \
pkg-config \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g editly hyperframes
FROM python:3.11-slim AS runtime
ARG DEBIAN_FRONTEND=noninteractive
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_ROOT_USER_ACTION=ignore
COPY --from=node-base /usr/local/bin/node /usr/local/bin/node
COPY --from=node-base /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -sf /usr/local/lib/node_modules/editly/cli.js /usr/local/bin/editly \
&& chmod +x /usr/local/lib/node_modules/editly/cli.js \
&& ln -sf /usr/local/lib/node_modules/hyperframes/dist/cli.js /usr/local/bin/hyperframes \
&& chmod +x /usr/local/lib/node_modules/hyperframes/dist/cli.js \
&& ln -sf /usr/local/bin/node /usr/local/bin/nodejs
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
fonts-inter \
fonts-noto \
fonts-dejavu-core \
curl \
libgl1 \
libegl1 \
libxi6 \
libgles2 \
libnss3 \
libx11-6 \
libx11-xcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libjpeg62-turbo \
libgif7 \
librsvg2-2 \
libpixman-1-0 \
libasound2 \
xvfb \
xauth \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --shell /bin/bash --uid 1000 vidapi
WORKDIR /app
COPY pyproject.toml README.md ./
RUN pip install --no-cache-dir . 2>/dev/null || true
COPY . .
RUN pip install --no-cache-dir .
COPY scripts/worker-healthcheck.sh /usr/local/bin/worker-healthcheck.sh
COPY scripts/worker-entrypoint.sh /usr/local/bin/worker-entrypoint.sh
RUN chmod +x /usr/local/bin/worker-healthcheck.sh /usr/local/bin/worker-entrypoint.sh
RUN mkdir -p /app/data /tmp/.X11-unix \
&& chmod 1777 /tmp/.X11-unix \
&& chown -R vidapi:vidapi /app
USER vidapi
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD /usr/local/bin/worker-healthcheck.sh
CMD ["/usr/local/bin/worker-entrypoint.sh"]