码头工人新手。
有一个带有 create-react-app 的标准构建。
我想问一下如何制作,以便在更新容器代码时重新启动程序集?
例如,在App.jsx
我将代码从
<h1>hello world</h1>
在
<h1>hello world zuzu</h1>
我想更新代码localhost
码头工人-compose.yml
version: "3"
services:
frontend:
build: ./dashboard
container_name: frontend
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"]
通过运行docker-compose up --build
试图通过docker-compose up --build --no-cache
还尝试添加这些设置
stdin_open: true
tty: true
到文件docker-compose.yml
,没有帮助
CI\CD 将帮助您解决这个问题。过程可能是这样的:
查看Github CI或Gitlab CI/CD