Home>
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, inApp.jsx
i change the code from
<h1>hello world</h1>
on
<h1>hello world zuzu</h1>
I would like the code to be updated inlocalhost
docker-compose.yml
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
Dockerfile
FROM node:13.12.0-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm i
COPY. .
cmd ["npm", "start"]
Launching throughdocker-compose up --build
Tried to launch viadocker-compose up --build --no-cache
Also tried adding these settings
stdin_open: true
tty:true
to filedocker-compose.yml
, did not help
-
Answer # 1
Related questions
- 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
CI\CD will help you with this. The process could be like this:
Look away or Gitlab CI/CD