-1

When I am running docker-compose up it gives me error:

python: can't open file 'manage.py': [Errno 1] Operation not permitted

I am using MacOS Monterey, Docker version 20.10.22, build 3a2c30b Docker Compose version v2.15.1

Here is my docker compose file

beanstalk-django:
    build: .
    command: bash -c "python manage.py migrate api && python manage.py runserver 0.0.0.0:8000"
    ports:
      - "80:8000"
    env_file:
      - .env
    depends_on:
      gpsdataviz-db:
        condition: service_healthy
    links:
      - "gpsdataviz-db"
    environment:
      - USER=${USER}
    volumes:
      - type: bind
        source: ./
        target: /code

I have tried changing permissions of docker and terminal from settings but not working either

  • The `volumes:` block overwrites everything in `/code` (probably your entire application) and replaces it with content from your host system. Does deleting that block help? – David Maze Feb 11 '23 at 13:00

1 Answers1

1

I met the same issue but I fixed it as follows.

  1. Open "System Preference" in the Apple menu
  2. Open the "Privacy" tab
  3. Click "Full Disk Access"
  4. Click "+"
  5. Add "Docker" and "Terminal", and check them
  6. Restart Docker and Terminal

enter image description here

Seito
  • 41
  • 2