Revert "npm login" (#4299)

Reverts Stirling-Tools/Stirling-PDF#4296
This commit is contained in:
Anthony Stirling
2025-08-26 14:06:29 +01:00
committed by GitHub
parent 4aac124e76
commit 9b8091a630
7 changed files with 5 additions and 49 deletions
+4 -22
View File
@@ -6,32 +6,14 @@ WORKDIR /app
# Copy package files
COPY frontend/package*.json ./
# Install dependencies (uses .npmrc secret if available, otherwise anonymous)
RUN --mount=type=secret,id=npmrc \
set -e && \
if [ -s /run/secrets/npmrc ]; then \
echo "Using authenticated npm registry" && \
echo "$(cat /run/secrets/npmrc)" > /root/.npmrc; \
else \
echo "Using anonymous npm registry (no token provided)"; \
fi && \
npm ci --loglevel=warn && \
rm -f /root/.npmrc
# Install dependencies
RUN npm ci
# Copy source code
COPY frontend .
# Build the application (uses .npmrc secret if available, otherwise anonymous)
RUN --mount=type=secret,id=npmrc \
set -e && \
if [ -s /run/secrets/npmrc ]; then \
echo "Using authenticated npm registry for build" && \
echo "$(cat /run/secrets/npmrc)" > /root/.npmrc; \
else \
echo "Using anonymous npm registry for build (no token provided)"; \
fi && \
npm run build && \
rm -f /root/.npmrc
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine