You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue while deploying my containerized application on Google Cloud Run. The Docker image builds successfully, but when I try to run it, I receive an error indicating that the container failed to listen on port 8080. Below are the details of my setup, the error message, and the Dockerfile used:
Error Message - "Ready condition status changed to False for Service blog-service with message: Revision 'blog-service-00001-khj' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.
"
Here's My Dockerfile
Use an official Node.js runtime as a parent image
FROM node:18-alpine
Set the working directory in the container
WORKDIR /app
Install pnpm globally and clean npm cache to reduce image size
RUN npm install -g pnpm && npm cache clean --force
Copy package.json and pnpm-lock.yaml (if available)
COPY package.json pnpm-lock.yaml ./
Install dependencies
RUN pnpm install
Copy the rest of the application code
COPY . .
Build the application
RUN pnpm run build
Expose the port the app runs on (default for Cloud Run is 8080)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, community.
I am encountering an issue while deploying my containerized application on Google Cloud Run. The Docker image builds successfully, but when I try to run it, I receive an error indicating that the container failed to listen on port 8080. Below are the details of my setup, the error message, and the Dockerfile used:
Error Message - "Ready condition status changed to False for Service blog-service with message: Revision 'blog-service-00001-khj' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.
"
Here's My Dockerfile
Use an official Node.js runtime as a parent image
FROM node:18-alpine
Set the working directory in the container
WORKDIR /app
Install pnpm globally and clean npm cache to reduce image size
RUN npm install -g pnpm && npm cache clean --force
Copy package.json and pnpm-lock.yaml (if available)
COPY package.json pnpm-lock.yaml ./
Install dependencies
RUN pnpm install
Copy the rest of the application code
COPY . .
Build the application
RUN pnpm run build
Expose the port the app runs on (default for Cloud Run is 8080)
EXPOSE 8080
Define the command to run the application
CMD ["pnpm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "8080"]
Any Help Would Be Much Appreciated.
Thanks In Advance.
Beta Was this translation helpful? Give feedback.
All reactions