package update
This commit is contained in:
17
DockerFile
17
DockerFile
@ -1,5 +1,6 @@
|
|||||||
# Stage 1: Build
|
# Stage 1: Build
|
||||||
FROM node:18-alpine AS builder
|
# Change from node:18-alpine to node:22-alpine
|
||||||
|
FROM node:22-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -7,7 +8,7 @@ WORKDIR /app
|
|||||||
ARG NEXT_PUBLIC_API_URL
|
ARG NEXT_PUBLIC_API_URL
|
||||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
|
||||||
# Copy package file
|
# Copy package files
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
|
|
||||||
# Install ALL dependencies (including dev dependencies for build)
|
# Install ALL dependencies (including dev dependencies for build)
|
||||||
@ -20,7 +21,8 @@ COPY . .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Run
|
# Stage 2: Run
|
||||||
FROM node:18-alpine AS runner
|
# Change from node:18-alpine to node:22-alpine
|
||||||
|
FROM node:22-alpine AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -31,12 +33,12 @@ ENV NODE_ENV=production
|
|||||||
ARG NEXT_PUBLIC_API_URL
|
ARG NEXT_PUBLIC_API_URL
|
||||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||||
|
|
||||||
# Copy necessary files
|
# Copy necessary files from the standalone build
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
|
|
||||||
# Create cache directory with wide-open permissions
|
# Create cache directory with proper permissions
|
||||||
RUN mkdir -p .next/cache/images && \
|
RUN mkdir -p .next/cache/images && \
|
||||||
chmod -R 777 .next/cache
|
chmod -R 777 .next/cache
|
||||||
|
|
||||||
@ -46,5 +48,8 @@ EXPOSE 3000
|
|||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
# Start the app (running as root to avoid permission issues)
|
# Set node options to fix the IPv6 issue we discussed earlier
|
||||||
|
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
|
||||||
|
|
||||||
|
# Start the app
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
Reference in New Issue
Block a user