GithubHelp home page GithubHelp logo

docker-compose's Introduction

docker-compose

Tutorial: Get started with Docker Compose

How can I start my services in the background?

docker compose up -d

How can I see what environment variables are available to the $SERVICE service defined in my docker-compose file?

SERVICE=web
docker compose run $SERVICE env

Note how this creates a container and then exists

$ docker ps -a
CONTAINER ID   IMAGE                COMMAND                  CREATED          STATUS                     PORTS     NAMES
0352eb7204cf   docker-compose_web   "env"                    2 seconds ago    Exited (0) 1 second ago              docker-compose_web_run_cf43592bca36
567aa67651ab   docker-compose_web   "env"                    3 minutes ago    Exited (0) 3 minutes ago             docker-compose_web_run_a506a07db24

How can I stop services running in the background?

docker compose stop

How can I bring everything down, removing the containers entirely? What if I also want to remove the data volume?

docker compose down

And to also remove the data volume:

docker compose down --volumes

Will stopping (ctrl+C or docker compose stop) remove containers?

No, the containers just exit. docker compose down will remove the containers. The stopped container is why the counter will remain the same when runing docker compose up in a loop while stopping it each time, the data remains the redis container.

docker-compose's People

Contributors

ygminds73 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.