【发布时间】:2022-01-24 04:26:58
【问题描述】:
作为标题。 我发现 docker-compose 无法检测到我的代码更改,即使我使用了 --force-recreate。
以下是我的目录结构。
根/
---docker-compose.yml
---/front/dockerFile
---/back/dockerFile
以下是我的代码。
docker-compose.yml
version: "3.9"
services:
node:
env_file: "./back/.env"
volumes:
- ./test:/backend/test
- ./back/node_modules:/backend/node_modules
build:
context: ./back
networks:
- testNetwork
next:
depends_on:
- node
build:
context: ./front
ports:
- "3000:3000"
networks:
- testNetwork
volumes:
- ./front/node_modules:/frontend/node_modules
- ./test:/frontend/test
networks:
testNetwork:
以下是我的行为。
1.使用 docker-compose up --force-recreate。
2.遇到一些错误。
3.尝试更改我的代码或 dockerfile 并保存。
4.同样的步骤1.
5.但是 docker-compose 无法检测到我的代码更改。
我的流程错了吗?
以及使用 docker-compose 的有效方法是什么?
我觉得我的流程效率低下。
谢谢大家。
【问题讨论】:
标签: docker docker-compose dockerfile