Fijxu
72f3df37e6
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m3s
41 lines
911 B
Docker
41 lines
911 B
Docker
FROM denoland/deno:debian-2.1.4 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 i.sanxian.tech/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"]
|