mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user