Refactor: Improve error handling in authentication flow
This commit is contained in:
+12
-16
@@ -11,7 +11,7 @@ COPY package*.json ./
|
||||
COPY frontend/package*.json ./frontend/
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install --legacy-peer-deps
|
||||
RUN --mount=type=cache,target=/root/.npm npm install --legacy-peer-deps
|
||||
|
||||
# Copy frontend source
|
||||
COPY frontend/ ./frontend/
|
||||
@@ -25,29 +25,25 @@ ARG NEXT_PUBLIC_SOLANA_RPC_URL
|
||||
WORKDIR /app/frontend
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||
RUN npx next build --webpack
|
||||
|
||||
# Build with standalone output
|
||||
RUN --mount=type=cache,target=/app/frontend/.next/cache npx next build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
COPY frontend/package*.json ./frontend/
|
||||
|
||||
# Copy node_modules from builder (includes compiled native modules)
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
|
||||
# Copy built files from builder
|
||||
COPY --from=builder /app/frontend/.next ./frontend/.next
|
||||
COPY --from=builder /app/frontend/public ./frontend/public
|
||||
COPY --from=builder /app/frontend/next.config.js ./frontend/
|
||||
|
||||
WORKDIR /app/frontend
|
||||
# Copy standalone output
|
||||
COPY --from=builder /app/frontend/.next/standalone ./
|
||||
COPY --from=builder /app/frontend/.next/static ./.next/static
|
||||
COPY --from=builder /app/frontend/public ./public
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
# Start application
|
||||
CMD ["npm", "start"]
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
Reference in New Issue
Block a user