diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ea09b93..6ba909b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -14,7 +14,10 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -ENV NEXT_TELEMETRY_DISABLED 1 +# Build-time environment variable for API URL +ARG NEXT_PUBLIC_API_URL=https://autonetsellcar.com +ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} +ENV NEXT_TELEMETRY_DISABLED=1 RUN npm run build @@ -22,8 +25,8 @@ RUN npm run build FROM base AS runner WORKDIR /app -ENV NODE_ENV production -ENV NEXT_TELEMETRY_DISABLED 1 +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs @@ -40,7 +43,7 @@ USER nextjs EXPOSE 3000 -ENV PORT 3000 -ENV HOSTNAME "0.0.0.0" +ENV PORT=3000 +ENV HOSTNAME=0.0.0.0 CMD ["node", "server.js"]