-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (44 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
60 lines (44 loc) · 1.26 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
FROM golang:1.26.1-bookworm AS builder
WORKDIR /build
# hadolint ignore=DL3015
RUN apt-get update && \
apt-get install -y \
git \
gcc \
unzip \
curl \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod tidy
COPY install.sh ./
COPY . .
RUN chmod +x install.sh && \
./install.sh -n --quiet --skip-summary && \
CGO_ENABLED=1 go build -v -trimpath -ldflags="-w -s" -o app ./cmd/app/
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y \
ffmpeg \
curl \
unzip \
zlib1g && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
RUN curl -fL \
https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux \
-o /usr/local/bin/yt-dlp && \
chmod 0755 /usr/local/bin/yt-dlp && \
curl -fsSL https://deno.land/install.sh -o /tmp/deno-install.sh && \
sh /tmp/deno-install.sh && \
rm -f /tmp/deno-install.sh
ENV DENO_INSTALL=/root/.deno
ENV PATH=$DENO_INSTALL/bin:$PATH
RUN useradd -r -u 10001 appuser && \
mkdir -p /app && \
chown -R appuser:appuser /app
WORKDIR /app
COPY --from=builder /build/app /app/app
RUN chown appuser:appuser /app/app
USER appuser
ENTRYPOINT ["/app/app"]