Something I'm trying to do is create a docker-compose application that has a single service act as a REPL that can interact with the rest of the services. I tried a variety of ways to get only this service attached to stdin and stdout but I haven't found anything elegant that worked. This stackoverflow post's answer said stdin_open: true
and tty: true
would work and here's what I made with it:
version: '3'
services:
redis:
image: redis
python:
image: python
entrypoint: /bin/sh
stdin_open: true
tty: true
Running docker-compose up
still sends a log of both services and docker-compose up -d
detaches both of the services. For this example is there an elegant way to get an interactive shell to the python service while only running docker-compose up ...
(i.e. not running docker exec
, etc)?