0

Im doing the platzi advanced django course. This course use docker-compose, the thing is, when i call "$docker-compose -f local.yml up" using the bash it shoms me the "ModuleNotFoundError : No module named 'cride'"

i have no idea why this erros is happening

version: '3'

volumes:
  local_postgres_data: {}
  local_postgres_data_backups: {}

services:
  django: &django
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: cride_local_django
    depends_on:
      - postgres
    volumes:
      - /c/users/jeanpython/desktop/cride/cride:/cride
    env_file:
      - ./.envs/.local/.django
      - ./.envs/.local/.postgres
    ports:
      - "8000:8000"
    command: /start

  postgres:
    build:
      context: .
      dockerfile: ./compose/production/postgres/Dockerfile
    image: cride_production_postgres
    volumes:
      - local_postgres_data:/var/lib/postgresql/data
      - local_postgres_data_backups:/backups
    env_file:
      - ./.envs/.local/.postgres

  redis:
    image: redis:3.2

  celeryworker:
    <<: *django
    image: cride_local_celeryworker
    depends_on:
      - redis
      - postgres

    ports: []
    command: /start-celeryworker

  celerybeat:
    <<: *django
    image: cride_local_celerybeat
    depends_on:
      - redis
      - postgres

    ports: []
    command: /start-celerybeat

  flower:
    <<: *django
    image: cride_local_flower
    ports:
      - "5555:5555"
    command: /start-flower

I expect the output to be "starting developming server at http://0.0.0.0:8000/"

Jean
  • 91
  • 1
  • 5
  • The `volumes:` directive you have there hides most of the setup work your Dockerfile does, and can contribute to problems like this. Providing a [mcve] including at least the Dockerfile (and reducing the `docker-compose.yml` to the essential containers to demonstrate the issue) would be helpful. – David Maze Jun 05 '19 at 00:29
  • The problem is... I don't know where the bug is. – Jean Jun 08 '19 at 07:23

1 Answers1

0

Hi i had finally solved it... When you're using toolbox, you're running into a VM (in my case is virtalbox), you have to set a shared folder that shares your path into the machine path. For more information about this solution: https://medium.com/@Charles_Stover/fixing-volumes-in-docker-toolbox-4ad5ace0e572

Jean
  • 91
  • 1
  • 5