machine icon indicating copy to clipboard operation
machine copied to clipboard

commands within docker-compose block don't work with docker machine

Open Cally99 opened this issue 4 years ago • 0 comments

Below block of code works fine locally (MAC Mojave) for project and runs django server, also works on EC2 ubuntu when docker and docker-compose are installed.

If I create a docker-machine env and run the project inside the vm the sh -c command won't work. ./wait-for-it.sh db:5432 not found. None of the commands work inside the block.

Is there any explanation why docker this type of command block won't work with docker machine?

   container_name: django  
   build:
     context: ./backend
   env_file: .env
   environment: 
     - DEBUG=True
   command: >
     sh -c "./wait-for-it.sh db:5432 && 
           ./autobets/manage.py collectstatic --no-input &&
           ./autobets/manage.py makemigrations &&
           ./autobets/manage.py migrate --no-input &&
           ./autobets/manage.py runserver_plus 0.0.0.0:8000
           "
   ports:
     - "8000:8000"  
   volumes:
     - ./backend:/app
   depends_on:
     - db
   restart: on-failure

Cally99 avatar Dec 02 '20 02:12 Cally99