invidious-companion/Dockerfile

42 lines
911 B
Text
Raw Permalink Normal View History

2024-12-16 07:46:18 -03:00
FROM denoland/deno:debian-2.1.4 AS builder
2024-10-20 19:36:42 -03:00
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
2024-12-15 15:24:09 -03:00
FROM i.sanxian.tech/alpine:3.20 AS user-stage
2024-10-20 19:36:42 -03:00
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
2024-10-20 19:36:42 -03:00
# 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"]