Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

309
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda