I'm new to docker.
There is a standard build with create-react-app.
I would like to ask how to make the build restart when the container code is updated?
For example, in
App.jsxi change the code from
<h1>hello world zuzu</h1>
I would like the code to be updated in
version: "3" services: frontend: build: ./dashboard container_name: front end command: npm run start restart: unless-stopped stdin_open: true tty:true ports: -"3000:3000" environment: -PORT=3000
FROM node:13.12.0-alpine WORKDIR /usr/src/app COPY package*.json ./ RUN npm i COPY. . cmd ["npm", "start"]
docker-compose up --build
Tried to launch via
docker-compose up --build --no-cache
Also tried adding these settings
stdin_open: true tty:true
docker-compose.yml, did not help
Answer # 1
CI\CD will help you with this. The process could be like this:
- You commit changes to your project repository
- Next, the CI /CD process is launched, which provides the build and deployment of the project
Look away or Gitlab CI/CD
- linux : Connecting via ssh when building using Jenkins
- docker : How to properly organize the launch of the container to obtain the result of its operation to the outer environment?
- Containers created in docker-compose.yml are automatically included all the time
- django : When the container is restarted, the database is reset to zero
- Why docker networks are needed?
- django : How to configure two projects on Docker and Nginx on one server?
- How to run Postgres in a Docker container (Warning: Host Is Already In Use by Another Container)
- I can not connect to PostgreSQL with Ruby on Rails environment in Docker-Compose
- linux : Does not start docker-compose although before everything worked well