From 2e634df92db36c0210919d348eb58771c4fc73bf Mon Sep 17 00:00:00 2001 From: journey-ad Date: Tue, 23 Jul 2024 15:34:17 +0800 Subject: [PATCH] :whale: Fix `ECONNREFUSED ::1:3000` error reference: https://github.com/nodejs/node/issues/41625 https://github.com/nodejs/node/issues/40702 --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fada134..c548c87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Use node:18-alpine as the base image -FROM node:18-alpine AS base +# Use node:20-alpine as the base image +FROM node:20-alpine AS base # Set the working directory WORKDIR /app @@ -7,7 +7,6 @@ WORKDIR /app # Install dependencies FROM base AS deps COPY package.json ./ -RUN npm config set registry 'https://registry.npmmirror.com/' RUN npm install # Build the application @@ -17,7 +16,7 @@ COPY . . RUN npm run build # Prepare the runner stage -FROM node:18-alpine AS runner +FROM node:20-alpine AS runner # Set the working directory WORKDIR /app @@ -33,7 +32,7 @@ COPY --from=builder /app/.next/server ./.next/server EXPOSE 3000 # Set environment variables -ENV HOSTNAME=0.0.0.0 PORT=3000 +ENV HOSTNAME=:: PORT=3000 # Start the application CMD ["node", "server.js"]