Here is kind of a guess based on the clues of your question.
When you do run containers via docker-compose up, please do mind that hitting CTRL+C will actually stop your containers.
Here is an example of doing this:
$ docker-compose up
[+] Running 1/0
⠿ Container docker-test-1 Created 0.0s
Attaching to docker-test-1
^CGracefully stopping... (press Ctrl+C again to force)
[+] Running 1/1
⠿ Container docker-test-1 Stopped 10.2s
canceled
The important part here being: ^CGracefully stopping...
If you want to keep them running, you will have to run docker-compose up in a detached mode, with the help of the -d option.
-d, --detach Detached mode: Run containers in the background,
print new container names. Incompatible with
--abort-on-container-exit.
Source: https://docs.docker.com/compose/reference/up/
So doing,
docker-compose up -d && docker ps
Should actually give you what you expected.
E.g.:
$ docker-compose up -d && docker ps
[+] Running 2/2
⠿ Network docker_default Created 0.1s
⠿ Container docker-test-1 Started 0.5s
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ab9f422247c9 alpine "tail -f /dev/null" 1 second ago Up Less than a second docker-test-1
And if you want to see all container, regardless of their state, you can use the -a option of docker ps.
--all , -a Show all containers (default shows just running)
Source: https://docs.docker.com/engine/reference/commandline/ps/
E.g.:
$ docker-compose up
[+] Running 2/2
⠿ Network docker_default Created 0.1s
⠿ Container docker-test-1 Created 0.1s
Attaching to docker-test-1
^CGracefully stopping... (press Ctrl+C again to force)
[+] Running 1/1
⠿ Container docker-test-1 Stopped 10.2s
canceled
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
615bcc6f1e50 alpine "tail -f /dev/null" 18 seconds ago Exited (137) 3 seconds ago docker-test-1