-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (38 loc) · 1.39 KB
/
Dockerfile
File metadata and controls
52 lines (38 loc) · 1.39 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
FROM denoland/deno:latest AS builder
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y git
# ARG EJS_COMMIT=5bc9811c7a2f64a88279d2b90884df2160e51b34
# RUN git init ejs && \
# cd ejs && \
# git remote add origin https://github.com/yt-dlp/ejs.git && \
# git fetch --depth 1 origin "$EJS_COMMIT" && \
# git checkout --detach FETCH_HEAD && \
# cd ..
# Temp use a new IAS fixed sig extractor
ARG EJS_COMMIT=2aa16f2ecb1629921eb17a5c4872827bc09a9edb
RUN git init ejs && \
cd ejs && \
git remote add origin https://github.com/kikkia/ejs.git && \
git fetch --depth 1 origin "$EJS_COMMIT" && \
git checkout --detach FETCH_HEAD && \
cd ..
COPY scripts/patch-ejs.ts ./scripts/patch-ejs.ts
RUN deno run --allow-read --allow-write ./scripts/patch-ejs.ts
RUN rm -rf ./ejs/.git ./ejs/node_modules || true
COPY . .
RUN deno compile \
--no-check \
--output server \
--allow-net --allow-read --allow-write --allow-env \
--include worker.ts \
server.ts
RUN mkdir -p /usr/src/app/player_cache && \
chown -R deno:deno /usr/src/app/player_cache
FROM gcr.io/distroless/cc-debian12
WORKDIR /app
COPY --from=builder /usr/src/app/server /app/server
COPY --from=builder --chown=nonroot:nonroot /usr/src/app/player_cache /app/player_cache
COPY --from=builder --chown=nonroot:nonroot /usr/src/app/docs /app/docs
USER nonroot
EXPOSE 8001
ENTRYPOINT ["/app/server"]