I am building a Django app to run using Docker.
In the docker-compose.yml file, I am using volumes to save changes.
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
When I create a new application within the Django project, I use...
docker-compose exec web python manage.py startapp app_name
Docker-compose writes the app (app_name) to my local file, as expected, but with a root owner. This is causing problems, because, if I want to then create a new file within the app, I don't have permission.
If I exit docker-compose and create the app as a user, then there are no issues.
How can I change the .yml file to fix this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…