docker compose interactive code example
Example 1: stdin_open
version: "3"
services:
app:
image: app:1.2.3
stdin_open: true # docker run -i
tty: true # docker run -t
Example 2: insert bash command to docker-compose file
# -c flag indicates to read from string. Combine with &&
command: >
bash -c "python manage.py makemigrations
&& python manage.py migrate
&& python manage.py runserver 0.0.0.0:8000"