score:0
for development purpose, just use npm start
which uses react-scripts to run and watch your application for changes.
to deploy your application using docker, you can use static files server like serve in docker. use dockerfile below.
from node:8-alpine
run npm install serve -g
copy build/ .
expose 5000
cmd ["serve", "-s", "."]
before you build the image, run npm run build
to produce a production ready distribution - which is a collection of all files in build
folder of your project
for more details on how to deploy react app created with create-react-app
create-react-app docs
score:0
you need to add the -it flag to run the container in interactive mode (keep stdin open and allocate a pseudo-tty):
docker run -it container_id
this is caused due to recent update in the create react app library and adding this flag should resolve your issue.
Source: stackoverflow.com
Related Query
- React Script exits immediate after starting development server using docker run command
- React server does not start in docker and exits after message Starting development server
- Unable to run a development build of a React app in a Docker container using node:alpine
- Docker container exiting immediately after starting when using npm init react-app
- Cant load a react app after starting server
- React build run on server using pm2
- docker-compose stops immediately after starting react app created using create-react-app
- Routes not loading after using "npm run build" in React
- Error after using docker compose up in react and express project
- Execute script after loading server side rendered React component
- Empty cache after server side rendering a request in isomorphic app using Apollo GraphQL and React
- React front end connects to the development server on my computer instead of the Node server on Azure VM where it is hosted from why using localhost
- React build run on server using pm2 in windows
- Run shell script/commands when starting flask development server
- Websocket error when using a proxy_pass to CRA development server using Nginx and Docker
- How to run callback function after mapDispatchToProps OR update the props, using react redux?
- Trigger PHP script after submit button - using react js
- React app docker container exits/restarts after executing npm run build command
- I'm having trouble working on a new react project. I've install all the necessary packages but still I can't run my server using npm start?
- Run or execute script after page is loaded with react helmet, react gatsbyjs
- white screen after using npm run build react app
- Run React application without server
- When using create-react-app why does the development server keep disconnecting?
- How to create and run a development build of an application using create-react-app configuration
- Missing Script when I run npm start to create React app
- React Testing Library - using 'await wait()' after fireEvent
- React Native on Ipad - Error - could not connect to development server
- can't run react app with docker container
- Why Code Coverage in react app is empty? Tried using npm run test -- --coverage. But always showing empty code coverage
- 'ReferenceError: Headers is not defined' when using Headers in a server side rendered react project
More Query from same tag
- Can we set state of react component in worker thread?
- How to link to nested routes in React Router
- Applying CSS classes to a dynamic collection of React nodes on a consistent delay
- How to store and populate data into dataGrid or table using reactJs and reactHooks?
- How can I render sidebar depend on user
- React-hook-form conditional validation of text field, based on if another checkbox is checked?
- What is difference between React vs React Fiber?
- Clear the input data after submit using typehead
- React Native: error: cannot find symbol > new AppCenterReactNativeAnalyticsPackage(MainApplication.this
- Get class instance of ReactElement
- Start countdown for N number of items on first render
- MVC vs. Flux ? Bidirectional vs. Unidirectional?
- How to add sass to webpack + react?
- POST error 400 "beer name must be defined"
- React event target value in onChange
- How to fix an Invariant Violation in React?
- Remove Event Handler using Abort Signal with Typescript and React
- How to implement edit photo like LinkedIn edit background feature in React.js?
- Disable Right Click in React.JS
- How can I pass fetched data between components?
- React Dropzone cancel file upload on a button click
- Getting a mousemove event from a component that doesn't want me to have it
- Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/html')
- Redux: Couldn't map function to property
- React Set State within useEffect refresh page
- How to show validation error in form in react js?
- styled components override parent props types
- how to i execute this query line by line and then send the result to frontend
- Local storage in react todo list
- Map function does not return items in React JSX