Skip to content

Commit

Permalink
🐳 Fix ECONNREFUSED ::1:3000 error
Browse files Browse the repository at this point in the history
  • Loading branch information
journey-ad committed Jul 23, 2024
1 parent 20f1b55 commit 2e634df
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# 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

# Install dependencies
FROM base AS deps
COPY package.json ./
RUN npm config set registry 'https://registry.npmmirror.com/'
RUN npm install

# Build the application
Expand All @@ -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
Expand All @@ -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"]

0 comments on commit 2e634df

Please sign in to comment.