# Docker compose vs docker run

**URL:** <https://support.openanalytics.eu/t/docker-compose-vs-docker-run/1429>\
**Category:** ShinyProxy\
**Created:** [November 26, 2019, 12:12am UTC](https://support.openanalytics.eu/t/docker-compose-vs-docker-run/1429 "2019-11-26T00:12:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://support.openanalytics.eu/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://support.openanalytics.eu/u/dan)\
**Post date:** [November 26, 2019, 12:12am UTC](https://support.openanalytics.eu/t/docker-compose-vs-docker-run/1429/1 "2019-11-26T00:12:57Z")

</div>

I’m new to shinyproxy and am slowly trying to build myself up to having a containerised environment that will allow me to serve my app to numerous people with various levels of permission.

As it stands I’ve been able to build a sample [repo](https://github.com/danwwilson/basic_shiny/tree/e2be829839f499ae88468eb1c276109bfdfbe299) that works when I execute the following (from the root directory of the repo):

1. `sudo docker build -t thedatacollective/basic_proxy ./shinyproxy` # to build the shinyproxy image
2. `sudo docker build -t thedatacollective/basic_shiny ./apps` # to build the app that gets served by shinyproxy
3. `sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --net tdc-net -p 8080:8080 thedatacollective/basic_proxy` # to launch the proxy

I can then navigate to `http://127.0.0.1:8080` and I am served with the login screen and with correct credentials the app will load correctly.

I am now trying to level up so I can get this working via `docker-compose`, which is causing me problems. At the moment when I run `docker-compose up --build` things build and I’m served with the shinyproxy login screen, however I eventually get a error 500 telling me the container did not respond in time.

I have tested that the application container works independently of shinyproxy. I have tested it using `docker run` and it does work those ways, however there must be something wrong in my understanding of `docker-compose` that is causing me grief.

When I’ve logged in I can see the application container exists, however the logs for shiny proxy tell me that the `Container unresponsive, trying again (2/10): http://9907791e28a4:3838`

I’d really appreciate any guidance available. I’ve done my best to look at other examples and repo’s but must just be missing something in my understanding.

Cheers  
Dan

---

<div class="post-metadata">

**Author:** ![mnazarov](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/mnazarov/32/216_2.png) [@mnazarov](https://support.openanalytics.eu/u/mnazarov)\
**Post date:** [November 26, 2019, 11:39am UTC](https://support.openanalytics.eu/t/docker-compose-vs-docker-run/1429/2 "2019-11-26T11:39:57Z")

</div>

I think you are missing network configuration in your docker-compose file, please also see examples in [https://github.com/openanalytics/useR-2019-docker-for-data-science/tree/master/shinyproxy-docker-compose](https://github.com/openanalytics/useR-2019-docker-for-data-science/tree/master/shinyproxy-docker-compose)

---

<div class="post-metadata">

**Author:** ![dan](https://support.openanalytics.eu/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://support.openanalytics.eu/u/dan)\
**Post date:** [November 26, 2019, 9:49pm UTC](https://support.openanalytics.eu/t/docker-compose-vs-docker-run/1429/3 "2019-11-26T21:49:19Z")

</div>

@mnazarov that solved the problem entirely. Now to level up to add Nginx into the `docker-compose` file.

I’d seen the network stuff in other examples but hadn’t been able to make it work.

For anyone who is trying this for themselves you can find a working version of the repo [here](https://github.com/danwwilson/basic_shiny/tree/ccabeacfcae7fe55552ee53c9572ed74f5ba345a)
