Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

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

Open
Cally99 opened this issue Dec 2, 2020 · 0 comments
Open

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

Cally99 opened this issue Dec 2, 2020 · 0 comments

Comments

@Cally99
Copy link

Cally99 commented Dec 2, 2020

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant