SHELL
docker compose multiple command
version: '3'
services:
app:
build:
context: .
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
docker-compose command multiple
command: >
bash -c "python manage.py migrate
&& python manage.py runserver 0.0.0.0:8000"
docker-compose command multiple
command: |
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
docker compose multiple command
version: '3.1'
services:
db:
image: postgres
web:
build: .
command:
- /bin/bash
- -c
- |
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db
docker-compose command multiple
command: bash -c "
python manage.py migrate
&& python manage.py runserver 0.0.0.0:8000
"
docker compose multiple command
---
version: "2"
services:
test:
image: alpine
entrypoint: ["/bin/sh","-c"]
command:
- |
echo a
echo b
echo c
docker-compose command multiple
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
docker compose multiple command
command:
- /bin/bash
- -c
- |
var=$$(echo 'foo')
echo $$var # prints foo
docker compose multiple command
#!/bin/bash
python manage.py migrate
exec "$@"
docker compose multiple command
version: '3'
services:
mongo:
container_name: mongo
image: mongo:3.2.12
ports:
- "27017:27017"
volumes:
- ./fixtures:/fixtures
- ./deploy:/deploy
- ../.data/mongodb:/data/db
command: sh /deploy/local/start_mongod.sh