Docker Compose with one Terminating Container

I’m having a docker compose setup of a database container, an application container and one container which pre-loads the database with necessary data.

I want to start all of the containers together with docker-compose up while the pre-loading container terminates after it is one with exit 0.

  • Docker: how to to get access to interactive mode once server started in foreground?
  • I can't run docker daemon on ubuntu 14.04 LTS (on VPS)
  • Debug django app running inside docker image, using pycharm debugger
  • How to send message by echo command to mac console? (Docker for Mac)
  • Searching for the most optimal solution with Django, Docker, virtualenv and Heroku deployment
  • docker multiple containers with static addresses
  • But terminating this one container takes down the complete setup with the message:

    composesetup_load_1 exited with code 0
    Gracefully stopping... (press Ctrl+C again to force)
    Stopping composesetup_app_1...
    Stopping composesetup_db_1...
    

    Is there any way of having multiple containers with different life-time in one docker-compose setup? If yes, how?

  • Can't connect to a docker container port where an app is listening
  • Run shell script inside Docker container from another Docker container?
  • Is there any way to access a docker (nginx) container via a local url like http://mydomain.dev?
  • Restore backup from Docker to Neo4j
  • Run multiple docker compose
  • Where is the Postgres username/password being created in this Dockerfile?
  • One Solution collect form web for “Docker Compose with one Terminating Container”

    My workaround for now is to keep the pre-loading container running by adding tail -f /dev/null to the end of the entrypoint script. This keeps the process running, while nothing actual happens.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.