'Stream closed EOF for pod in kubernetes cluster

I am deploying django-react web app on kubernetes I have created the pod for backend its created fine and have status running but I have followed the same steps for the frontend but the pods is not cretaed successfully. Its status changes to CrashLoopBackOff right after Completed when I check its logs it showing this error "Stream closed EOF for default/frontend-deployment-56948f4cd4-nsfqx (frontend)". I am using microk8s and have pushed frontend image to microk8s default docker registry.

frontend.Dockerfile

FROM node:13.12.0-alpine
WORKDIR /app/frontend

COPY package.json package-lock.json ./
RUN npm install
RUN npm install [email protected] -g
COPY . ./
EXPOSE 3000

frontend-deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name : frontend-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: frontend
  template:
    metadata:
      labels:
        component: frontend
    spec:
      containers:
        - name: frontend
          image: localhost:32000/frontend:latest
          command: ["npm", "start"]
          ports:
          - containerPort: 3000

What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source