# Connecting two Compose applications

**URL:** <https://forums.docker.com/t/connecting-two-compose-applications/64069>\
**Category:** Compose\
**Created:** [November 30, 2018, 1:56am UTC](https://forums.docker.com/t/connecting-two-compose-applications/64069 "2018-11-30T01:56:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![infojunkie](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/infojunkie/32/36907_2.png) [@infojunkie](https://forums.docker.com/u/infojunkie)\
**Post date:** [November 30, 2018, 1:56am UTC](https://forums.docker.com/t/connecting-two-compose-applications/64069/1 "2018-11-30T01:56:57Z")

</div>

I am using two separate apps locally, each having its own Compose file. Now I’d like app B to access an API from app A (which happens to be exposed on locahost:3000). How can I do that, preferably with no change to either Compose file?

---

<div class="post-metadata">

**Author:** ![infojunkie](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/infojunkie/32/36907_2.png) [@infojunkie](https://forums.docker.com/u/infojunkie)\
**Post date:** [December 1, 2018, 1:26am UTC](https://forums.docker.com/t/connecting-two-compose-applications/64069/2 "2018-12-01T01:26:34Z")

</div>

I ended up changing the Compose file for app A, adding an external network entry:

```
networks:
  dev:
  out:
    external:
      name: "${NETWORK:-check_dev}"

```

The default external network name is the same as the internal one - this way I don’t require the `$NETWORK` env var to be present.

Now app A (which exposes the API) can be exposed to app B that wants to consume the API. B simply refers to the service name of the API as defined by A.
