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.confIntenté 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.