Merge remote-tracking branch 'origin/master'

This commit is contained in:
maxDorninger
2025-06-30 18:08:52 +02:00
11 changed files with 118 additions and 28 deletions

View File

@@ -1,28 +1,39 @@
ARG VERSION
ARG BASE_URL=""
FROM node:24-alpine AS build
USER node:node
WORKDIR /app
ARG VERSION
ARG BASE_URL
COPY --chown=node:node . .
# Copy package files first for better layer caching
COPY package*.json ./
RUN npm ci && npm cache clean --force
RUN npm ci
# Copy source code after dependencies are installed
COPY . .
RUN env PUBLIC_VERSION=${VERSION} BASE_URL=${BASE_URL} npm run build
FROM node:24-alpine AS frontend
ARG VERSION
USER node:node
USER node
EXPOSE 3000
WORKDIR /app
LABEL version=${VERSION}
LABEL description="Docker image for the web frontend of MediaManager"
ENV PUBLIC_VERSION=${VERSION}
ENV PUBLIC_SSR_WEB=false
WORKDIR /app
COPY --chown=node:node package*.json ./
COPY --chown=node:node --from=build /app/node_modules ./node_modules/
COPY --chown=node:node --from=build /app/build/ ./build/
# Copy built application and package files
COPY --from=build /app/build ./build
COPY --from=build /app/package*.json ./
COPY --chmod=755 entrypoint.sh .
EXPOSE 3000
# Install only production dependencies needed for the Node adapter
RUN npm ci --only=production && npm cache clean --force
CMD ["/app/entrypoint.sh"]
CMD ["node","build/index.js"]

16
web/entrypoint.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
# This script is used to start the MediaManager frontend service.
# text created with https://patorjk.com/software/taag/ font: Slanted
cat << EOF
__ ___ ___ __ ___ ______ __ __
/ |/ /__ ____/ (_)___ _/ |/ /___ _____ ____ _____ ____ _____ / ____/________ ____ / /____ ____ ____/ /
/ /|_/ / _ \/ __ / / __ \`/ /|_/ / __ \`/ __ \/ __ \`/ __ \`/ _ \/ ___/ / /_ / ___/ __ \/ __ \/ __/ _ \/ __ \/ __ /
/ / / / __/ /_/ / / /_/ / / / / /_/ / / / / /_/ / /_/ / __/ / / __/ / / / /_/ / / / / /_/ __/ / / / /_/ /
/_/ /_/\___/\__,_/_/\__,_/_/ /_/\__,_/_/ /_/\__,_/\__, /\___/_/ /_/ /_/ \____/_/ /_/\__/\___/_/ /_/\__,_/
/____/
EOF
echo "Buy me a coffee at https://buymeacoffee.com/maxdorninger"
echo "Starting MediaManager frontend service..."
node build/index.js

View File

@@ -99,7 +99,7 @@
<img class="size-12" src={logo} alt="Media Manager Logo" />
<div class="grid flex-1 text-left text-sm leading-tight">
<span class="truncate font-semibold">Media Manager</span>
<span class="truncate text-xs">v{PUBLIC_VERSION}</span>
<span class="truncate text-xs">{PUBLIC_VERSION}</span>
</div>
</a>
{/snippet}

View File

@@ -27,7 +27,7 @@
let url = new URL(apiUrl + `/movies/${movie.id}/torrents`);
url.searchParams.append('public_indexer_result_id', result_id);
if (filePathSuffix !== '') {
url.searchParams.append('file_path_suffix', filePathSuffix);
url.searchParams.append('override_file_path_suffix', filePathSuffix);
}
try {
const response = await fetch(url, {