diff --git a/0271785-1d039172-cbf9-498c-bd54-2fff2c0c2c75.jpg b/0271785-1d039172-cbf9-498c-bd54-2fff2c0c2c75.jpg deleted file mode 100644 index 7e395d8..0000000 Binary files a/0271785-1d039172-cbf9-498c-bd54-2fff2c0c2c75.jpg and /dev/null differ diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5de4140..35cdbac 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,13 +1,40 @@ +# Use node 18 alpine for smaller image size FROM node:18-alpine WORKDIR /app -COPY package*.json ./ -RUN npm ci --omit=dev +# Install dumb-init for proper signal handling +RUN apk add --no-cache dumb-init +# Copy package files +COPY package*.json ./ + +# Install all dependencies (including devDependencies needed for build) +# Set npm config for better CI performance +RUN npm ci --prefer-offline --no-audit + +# Copy source code COPY . . + +# Set Node.js memory limit for build (helpful in constrained environments) +ENV NODE_OPTIONS="--max-old-space-size=1024" + +# Build the application RUN npm run build +# Remove devDependencies after build to reduce image size +RUN npm prune --omit=dev + +# Create non-root user for security +RUN addgroup -g 1001 -S nodejs +RUN adduser -S nextjs -u 1001 + +# Change ownership of the app directory +RUN chown -R nextjs:nodejs /app +USER nextjs + EXPOSE 3000 +# Use dumb-init to handle signals properly +ENTRYPOINT ["dumb-init", "--"] CMD ["npm", "start"] \ No newline at end of file diff --git a/frontend/Dockerfile.alternative b/frontend/Dockerfile.alternative new file mode 100644 index 0000000..e12a893 --- /dev/null +++ b/frontend/Dockerfile.alternative @@ -0,0 +1,42 @@ +# Multi-stage build for better caching and smaller final image +FROM node:18-alpine AS dependencies + +WORKDIR /app +COPY package*.json ./ +RUN npm ci + +FROM node:18-alpine AS builder + +WORKDIR /app +COPY --from=dependencies /app/node_modules ./node_modules +COPY . . + +# Increase memory limit for build +ENV NODE_OPTIONS="--max-old-space-size=2048" + +RUN npm run build + +FROM node:18-alpine AS runner + +WORKDIR /app + +# Install dumb-init +RUN apk add --no-cache dumb-init + +# Create non-root user +RUN addgroup -g 1001 -S nodejs +RUN adduser -S nextjs -u 1001 + +# Copy necessary files +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static + +# Set correct permissions +RUN chown -R nextjs:nodejs /app +USER nextjs + +EXPOSE 3000 + +ENTRYPOINT ["dumb-init", "--"] +CMD ["node", "server.js"] \ No newline at end of file diff --git a/swissmilk_hamburger.pdf b/swissmilk_hamburger.pdf deleted file mode 100644 index 9ae9058..0000000 Binary files a/swissmilk_hamburger.pdf and /dev/null differ