Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
Recarga en caliente en React usando Docker

Tengo 2 contenedores docker en ejecución, uno para una API y otro para el front-end (compilado con React) de la aplicación. Me gustaría que el contenedor frontal se actualice cada vez que realice un cambio. El contenedor de la API no tiene que actualizarse con el cambio.

doker-compose.yml:

 services: api: build: context: . dockerfile: Dockerfile.api image: controle-app-api client: build: context: . dockerfile: Dockerfile.client image: controle-app-client volumes: - ./:/app ports: - "3000:3000" environment: CHOKIDAR_USEPOLLING: "true"

Dockerfile.cliente:

 # Build step #1: build the React front end FROM node:16-alpine as build-step # Specify where our app will live in the container WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH # Copy the React App to the container COPY package.json package-lock.json ./ COPY ./src ./src COPY ./public ./public # Prepare the container for building React RUN npm install RUN npm install react-scripts@3.0.1 -g # We want the production version RUN npm run build # Prepare nginx FROM nginx:stable-alpine COPY --from=build-step /app/build /usr/share/nginx/html COPY deployment/nginx.default.conf /etc/nginx/conf.d/default.conf

Intenté aplicar la respuesta dada en Cómo recargar en caliente en ReactJS Docker , pero esto no ayudó. Cada vez que edito algo en un archivo .JS, no se actualiza al recargar la aplicación.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!