forked from kikkia/yt-cipher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 1.09 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
FROM denoland/deno:latest AS builder
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y git
ARG EJS_COMMIT=cd4e87f52e87ab6d8b318fd3a817adda6fafa8dc
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 ..
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"]