update latest
This commit is contained in:
12
DockerFile
12
DockerFile
@ -3,6 +3,10 @@ FROM node:18-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Build arguments - MUST be before COPY to be available during build
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
@ -12,10 +16,6 @@ RUN npm ci
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build arguments
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
|
||||
# Build the app
|
||||
RUN npm run build
|
||||
|
||||
@ -27,6 +27,10 @@ WORKDIR /app
|
||||
# Set to production
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Runtime environment variable
|
||||
ARG NEXT_PUBLIC_API_URL
|
||||
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
|
||||
# Copy necessary files
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
|
||||
Reference in New Issue
Block a user