Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

310
Vistas
Live reload react app working with docker-compose

I have two services: front (product-list) and backend (server-api).

I've created a docker-compose file and it works fine:

version: '3.1'

services:
  server-api:
    build: ./server-api
    ports: 
      - "8080:8080"
  product-list:
    build: ./product-list
    environment:
      CHOKIDAR_USEPOLLING: "true"
    ports: 
      - "3000:3000"
    depends_on:
      - server-api

But I have a problem: the app doesnt reload after a change.

I have read about this, and a lot of people says that CHOKIDAR_USEPOLLING: "true" should works.

It doesnt for me.

I would like to know if is a volume problem (I dont have very clear how they work right now or what volume should I create), or if maybe I should install something to watch the files.

This is the Dockerfile that I have in my frontend app:

FROM node:14-alpine AS development

ENV NODE_ENV development

WORKDIR /app

COPY package.json .
COPY package-lock.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "start"]

And right now I just use docker-compose up to launch the app.

I just need to know about what happend with my react app and why it doesnt reload, backend service (server-api) works fine and I dont need hot reload in that app.

Any help is thankful.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For the changes to get into container, you need to mount the project as volume. In the current configuration, changes to the project will fall into container only after rebuilding the image.

As example:

  product-list:
    build: ./product-list
    environment:
      CHOKIDAR_USEPOLLING: "true"
    ports: 
      - "3000:3000"
    depends_on:
      - server-api
    volumes:
      - ".:/app"
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda