[HPM] Proxy created: /auth/google -> my-node-server:5000
[HPM] Proxy created: /api/* -> my-node-server:5000
ℹ 「wds」: Project is running at 172.18.0.2/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /usr/src/app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
my dockerfile is simple:
pull official base image
FROM node:12-slim
set working directory
WORKDIR /usr/src/app
install app dependencies
COPY package*.json ./
RUN npm install
RUN npm install react-scripts@3.4.1 -g
add app
COPY . ./
start app
CMD ["npm", "start"]
But if I run it in my node js console using "npm start" i can start my dev without issue...
Hi, I am Mubbashir. I specialize in developing highly scalable & distributed web apps. I help startups in developing their apps & ideas. Here I usually write about Microservices, DevOps, AWS and React
Ah, so you are trying to use it for development purposes. When we deploy on ECS, we do it for production. For production, you need to use a multistage docker (first build the react app, second copy the built files and serve using Nginx - no nodejs server involved).
For development, you don't need to use ECS. That's something that you will be doing on your local machine, and it's totally fine to use -it for it. You may also want to attach volume to your code directory if you are developing via docker :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Mubbashir,
If I run without the interactive mode with below cli
docker run --rm --name=my-react-app --network=mynetwork -p 3000:3000 my-react-app-image
I am getting the server stopped at "Starting the development server..." as shown below:
[HPM] Proxy created: /auth/google -> my-node-server:5000
[HPM] Proxy created: /api/* -> my-node-server:5000
ℹ 「wds」: Project is running at 172.18.0.2/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /usr/src/app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
my dockerfile is simple:
pull official base image
FROM node:12-slim
set working directory
WORKDIR /usr/src/app
install app dependencies
COPY package*.json ./
RUN npm install
RUN npm install react-scripts@3.4.1 -g
add app
COPY . ./
start app
CMD ["npm", "start"]
But if I run it in my node js console using "npm start" i can start my dev without issue...
Thanks,
Ah, so you are trying to use it for development purposes. When we deploy on ECS, we do it for production. For production, you need to use a multistage docker (first build the react app, second copy the built files and serve using Nginx - no nodejs server involved).
For development, you don't need to use ECS. That's something that you will be doing on your local machine, and it's totally fine to use
-it
for it. You may also want to attach volume to your code directory if you are developing via docker :)