-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
41 lines (26 loc) · 897 Bytes
/
Dockerfile
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
FROM denoland/deno:debian-1.46.3 AS builder
ARG TINI_VERSION=0.19.0
WORKDIR /app
RUN apt update && apt install -y curl
COPY ./src/ /app/src/
COPY deno.json /app/
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$(dpkg --print-architecture) \
--output /tini \
&& chmod +x /tini
RUN deno task compile
# Stage for creating the non-privileged user
FROM alpine:3.20 AS user-stage
RUN adduser -u 10001 -S appuser
FROM gcr.io/distroless/cc
COPY --from=builder /app/invidious_companion /app/
COPY ./config/ /app/config/
COPY --from=builder /tini /tini
ENV PORT=8282 \
HOST=0.0.0.0
# Copy passwd file for the non-privileged user from the user-stage
COPY --from=user-stage /etc/passwd /etc/passwd
# Set the working directory
WORKDIR /app
# Switch to non-privileged user
USER appuser
ENTRYPOINT ["/tini", "--", "/app/invidious_companion"]