Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Jul 26, 2024
2 parents 20bc844 + ed247ea commit dfa806c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,18 @@ ARG TARGETVARIANT

WORKDIR /app

# Install under /root/.local
ENV PIP_USER="true"
ARG PIP_NO_WARN_SCRIPT_LOCATION=0
ARG PIP_ROOT_USER_ACTION="ignore"
ARG PIP_NO_COMPILE="true"
ARG PIP_DISABLE_PIP_VERSION_CHECK="true"

RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=aptlists-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/lib/apt/lists \
apt-get update && apt-get install -y --no-install-recommends \
python3.12 \
# Cleanup
find "/root/.local" -name '*.pyc' -print0 | xargs -0 rm -f || true ; \
find "/root/.local" -type d -name '__pycache__' -print0 | xargs -0 rm -rf || true ;
python3

ARG UID
# ffmpeg
COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/static-ffmpeg-upx:7.0-1 /ffmpeg /usr/bin/
COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/static-ffmpeg-upx:7.0-1 /ffprobe /usr/bin/

# yt-dlp
COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/yt-dlp:distroless /home/monty/.local /usr/bin/
ADD --link --chown=$UID:0 --chmod=775 https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp /usr/bin/yt-dlp

########################################
# Build stage
Expand Down Expand Up @@ -68,7 +58,7 @@ RUN --mount=source=.,target=.,rw \
########################################
# Final stage
########################################
FROM base as final
FROM base AS final

ARG UID
# Support arbitrary user ids (OpenShift best practice)
Expand All @@ -78,6 +68,7 @@ RUN chown -R $UID:0 /azure-functions-host && \

# Create directories with correct permissions
RUN install -d -m 775 -o $UID -g 0 /home/site/wwwroot && \
install -d -m 775 -o $UID -g 0 /home/.cache && \
install -d -m 775 -o $UID -g 0 /licenses

# dumb-init
Expand All @@ -96,7 +87,6 @@ COPY --link --chown=$UID:0 --chmod=775 --from=ghcr.io/jim60105/yt-dlp:distroless
COPY --link --chown=$UID:0 --chmod=775 --from=publish /app /home/site/wwwroot

ENV PATH="/home/site/wwwroot:/home/$UID/.local/bin:$PATH"
ENV PYTHONPATH "/home/$UID/.local/lib/python3.12/site-packages:${PYTHONPATH}"

ENV AzureWebJobsScriptRoot=/home/site/wwwroot
ENV FUNCTIONS_WORKER_RUNTIME=dotnet-isolated
Expand Down Expand Up @@ -144,7 +134,7 @@ ENV Twitch_ClientSecret=
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080

USER $UID
USER $UID:0

STOPSIGNAL SIGINT

Expand Down
2 changes: 1 addition & 1 deletion LivestreamRecorderBackend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Seq" Version="7.0.1" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="TwitchLib.Api" Version="3.9.0" />
<PackageReference Include="ValueInjecter" Version="3.2.0" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6" />
Expand Down

0 comments on commit dfa806c

Please sign in to comment.