docker-compose up is starting the container and immediately stopping them
If you use bash
as the command
, but without a terminal, it will exit immediately. This is because when bash starts up, if there is no terminal attached, and it has no script or other command to execute, it has nothing to do, so it exits (by design).
You can either use a different command
, or attach a terminal with tty: true
as part of the definition of this service.
services:
composetestdb:
tty: true
...