mi archivo docker:
# Use the official Node.js 10 image. # https://hub.docker.com/_/node FROM node:13.12.0-alpine # set working directory WORKDIR /app # add `/app/node_modules/.bin` to $PATH ENV PATH /app/node_modules/.bin:$PATH # install app dependencies COPY package.json ./ RUN npm install # RUN npm install react-scripts@3.4.3 -g # add app COPY . /app CMD ["npm", "start"]construyo:
$ docker build . -t myapp Sending build context to Docker daemon 2.051MB Step 1/7 : FROM node:13.12.0-alpine ---> 483343d6c5f5 Step 2/7 : WORKDIR /app ---> Using cache ---> c731f744759f Step 3/7 : ENV PATH /app/node_modules/.bin:$PATH ---> Using cache ---> e1f5f853c8c6 Step 4/7 : COPY package.json ./ ---> Using cache ---> f831911acf6c Step 5/7 : RUN npm install ---> Using cache ---> c18449857dd2 Step 6/7 : COPY . /app ---> Using cache ---> 4b99412d4725 Step 7/7 : CMD ["npm", "start"] ---> Using cache ---> e565a34838d5 Successfully built e565a34838d5 Successfully tagged myapp:latest SECURITY WARNING: You are building a Docker image from Windows against a non-Win dows Docker host. All files and directories added to build context will have '-r wxr-xr-x' permissions. It is recommended to double check and reset permissions f or sensitive files and directories.Correr:
ventana acoplable ejecutar -p 3000 mi aplicación
> myapp-fe@0.1.0 start /app > react-scripts start ℹ 「wds」: Project is running at http://172.17.0.3/ ℹ 「wds」: webpack output is served from ℹ 「wds」: Content not from webpack is served from /app/public ℹ 「wds」: 404s will fallback to / Starting the development server... Compiled successfully! You can now view rugvista-fe in the browser. Local: http://localhost:3000 On Your Network: http://172.17.0.3:3000 Note that the development build is not optimized. To create a production build, use npm run build.Visitando: http://localhost:3000/ da ERR_EMPTY_RESPONSE
¿Qué estoy haciendo mal?
Agregue esto en su archivo docker antes de que comience npm
EXPOSE 3000/tcp Modifica tu COPY . /app para COPY . .