虽然我已经看到了其他问题 - 到目前为止,没有提出的解决方案或文档对我有帮助。如果这有点多余,请道歉。
我正在尝试在我的docker-compose.yml文件中安装一个卷,以便在我进行更改时“热重新加载”我的代码。我正在运行一个烧瓶应用程序。我的文件结构如下:
??? celery_queue
? ??? Dockerfile
? ??? requirements.txt
? ??? tasks.py
??? docker-compose.yml
??? my_test_app
? ??? Dockerfile
? ??? app
? ? ??? __init__.py
? ??? my_test_app.py
? ??? requirements.txt
? ??? worker.py
??? run.sh
??? stop.sh
Run Code Online (Sandbox Code Playgroud)
我的docker-compose.yml:
version: "3"
services:
redis:
image: "redis:alpine"
web:
build:
context: ./my_test_app
dockerfile: Dockerfile
restart: always
volumes:
- ./my_test_app:/my_test_app
ports:
- "5000:5000"
depends_on:
- redis
worker:
build:
context: celery_queue
dockerfile: Dockerfile
depends_on:
- redis
monitor: …Run Code Online (Sandbox Code Playgroud)