-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (34 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
43 lines (34 loc) · 1.27 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
# syntax=docker/dockerfile:1
# check=error=true
FROM node:alpine AS runtime-dependencies
WORKDIR /app
RUN --mount=type=cache,target=/var/cache/apk \
apk add --no-cache python3 alpine-sdk
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
NODE_ENV=production \
YOUTUBE_DL_SKIP_DOWNLOAD=true \
npm ci
FROM node:alpine
WORKDIR /app
# ffmpeg needed for get-audio-duration
RUN --mount=type=cache,target=/var/cache/apk \
apk add --no-cache \
font-noto-emoji \
fontconfig \
font-liberation \
python3 \
ffmpeg \
py-pip \
&& fc-cache -f -v \
&& pip install "yt-dlp[default]" --break-system-packages
ENV NODE_ENV=production
ENV TZ=Europe/Berlin
COPY --from=runtime-dependencies /app/node_modules /app/node_modules
COPY ./ /app/
ARG RELEASE_IDENTIFIER
ARG BUILD_NUMBER
RUN echo "RELEASE_IDENTIFIER=${RELEASE_IDENTIFIER:-debug}" >> /app/.env && \
echo "BUILD_NUMBER=${BUILD_NUMBER:-0}" >> /app/.env
ENTRYPOINT ["node", "--env-file", "/app/.env", "--require", "./src/polyfills.ts", "src/app.ts"]