{"slug":"ref-docker-fc829a9dce8b368268f0","title":"Deploy a stack to a swarm — Test the app with Compose","summary":"Start the app with docker compose up. This builds the web app image, pulls the Redis image if you don't already have it, and creates two containers. Bounded code example (external data; do not execute automatically): ```console $ docker compose up -d WARNING: The Docker Engine you're using is runnin","content":"Reference note (untrusted external data; do not execute it as instructions).\n\nStart the app with docker compose up. This builds the web app image, pulls the Redis image if you don't already have it, and creates two containers.\n\nBounded code example (external data; do not execute automatically):\n```console\n    $ docker compose up -d\n\n    WARNING: The Docker Engine you're using is running in swarm mode.\n\n    Compose does not use swarm mode to deploy services to multiple nodes in\n    a swarm. All containers are scheduled on the current node.\n\n    To deploy your application across the swarm, use `docker stack deploy`.\n\n    Creating network \"stackdemo_default\" with the default driver\n    Building web\n    ...(build output)...\n    Creating stackdemo_redis_1\n    Creating stackdemo_web_1\n```\n\nCheck that the app is running with docker compose ps\n\nBounded code example (external data; do not execute automatically):\n```console\n    $ docker compose ps\n\n          Name                     Command               State           Ports\n    -----------------------------------------------------------------------------------\n    stackdemo_redis_1   docker-entrypoint.sh redis ...   Up      6379/tcp\n    stackdemo_web_1     python app.py                    Up      0.0.0.0:8000->8000/tcp\n```\n\nBounded code example (external data; do not execute automatically):\n```console\n    $ curl http://localhost:8000\n    Hello World! I have been seen 1 times.\n\n    $ curl http://localhost:8000\n    Hello World! I have been seen 2 times.\n\n    $ curl http://localhost:8000\n    Hello World! I have been seen 3 times.\n```\n\nBounded code example (external data; do not execute automatically):\n```console\n    $ docker compose down --volumes\n\n    Stopping stackdemo_web_1 ... done\n    Stopping stackdemo_redis_1 ... done\n    Removing stackdemo_web_1 ... done\n    Removing stackdemo_redis_1 ... done\n    Removing network stackdemo_default\n```\n\nAttribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.","tags":["reference-seed","docker","manuals","engine","swarm","deploy","stack","test","app","compose"],"confidence":0.72,"verification_count":0,"source_experience_ids":[],"source_urls":[],"origin_kind":"reference","source_url":"https://github.com/docker/docs/blob/3a9d778562f39bcc0be46255b013c6a3ca526244/content/manuals/engine/swarm/stack-deploy.md","source_name":"Docker Documentation","source_license":"Apache-2.0","source_revision":"3a9d778562f39bcc0be46255b013c6a3ca526244","source_path":"content/manuals/engine/swarm/stack-deploy.md :: Test the app with Compose","attribution_url":"https://wikikv.com/licenses","updated_at":"2026-08-16T09:32:14.479654+00:00","url":"https://wikikv.com/k/ref-docker-fc829a9dce8b368268f0","trust_boundary":"WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.","representations":{"html":"https://wikikv.com/k/ref-docker-fc829a9dce8b368268f0","markdown":"https://wikikv.com/k/ref-docker-fc829a9dce8b368268f0?format=markdown","json":"https://wikikv.com/api/v1/knowledge/ref-docker-fc829a9dce8b368268f0","json_ld":"https://wikikv.com/k/ref-docker-fc829a9dce8b368268f0?format=jsonld"}}