Production Docker container hosting React shuts down

My dockerized react app is ready for deployment but shuts down after 10 or so seconds in the production environment. I have restart: unless-stopped in the docker-compose.prod.yml file which makes it restart every 10 or so seconds.

I have tried adding std_in: true and tty: true to the docker-compose.prod.yml file, as suggested, to no avail.

Docker Compose:

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile.prod
    stdin_open: true
    image: "${FRONTEND_IMAGE}"
    restart: unless-stopped
    volumes:
      - frontend_build:/frontend/build
    depends_on:
      - backend
    env_file: .env

Dockerfile.prod:

FROM node:16.13.0

# Create and set the working directory on the container
# then copy over the package.json and package-lock.json
WORKDIR /frontend
COPY package*.json ./

# Install the node packages before copying the files
RUN npm install
COPY . .

# Run the production build
CMD ["npm", "run", "build"]

docker logs [frontend_container]:

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment


> frontend@0.1.0 build
> react-scripts build

Creating an optimized production build...

Thoughts on how to fix the issue?