# Gateway timeout when traefik and app in separate docker-compose files

**URL:** <https://community.traefik.io/t/gateway-timeout-when-traefik-and-app-in-separate-docker-compose-files/5821>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [April 30, 2020, 9:30am UTC](https://community.traefik.io/t/gateway-timeout-when-traefik-and-app-in-separate-docker-compose-files/5821 "2020-04-30T09:30:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![levasc](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@levasc](https://community.traefik.io/u/levasc)\
**Post date:** [April 30, 2020, 9:30am UTC](https://community.traefik.io/t/gateway-timeout-when-traefik-and-app-in-separate-docker-compose-files/5821/1 "2020-04-30T09:30:39Z")

</div>

Hi, I am trying to use separate docker-compose.yml files for traefik and app. But get gateway timout error for the app.

My traefik docker-compose file:

```auto
version: '3.3'
services:
  reverse-proxy:
    image: traefik:v2.2
    ports:
    # The HTTP port
    - "80:80"
    # The Web UI (enabled by --api.insecure=true)
    - "8080:8080" # Enables the web UI and tells Traefik to listen to docker
    - "8443:8443"
    - "443:443"
    container_name: traefik
    restart: unless-stopped
    command:
      - --api
      - --api.insecure=true
      - --providers.docker
      - --providers.docker.exposedbydefault=false
      - --log.level=INFO
      - --api.dashboard=true
      - --entrypoints.websecure.address=:443
      - --entrypoints.web.address=:80
      - --entrypoints.jitsi.address=:8443
      # - --certificatesResolvers.myresolver.acme.tlschallenge=true # <== Enable TLS-ALPN-01 to generate and renew ACME certs
      -` [`--certificatesResolvers.myresolver.acme.email=asdasasdas@gmail.com`](mailto:--certificatesResolvers.myresolver.acme.email=levas.cernovas@gmail.com) `# <== Setting email for certs
      - --certificatesResolvers.myresolver.acme.storage=/letsencrypt/acme.json # <== Defining acme file to store cert information
      - --certificatesResolvers.myresolver.acme.httpChallenge.entryPoint=web
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
      - letsencrypt:/letsencrypt/
    networks:
      - web
    labels:
      traefik.enable: true
      traefik.http.routers.http_catchall.rule: hostregexp(` {host:.+}`)
      traefik.http.routers.http_catchall.entrypoints: web
      traefik.http.routers.http_catchall.tls: true
      #Dashboard
      traefik.http.routers.traefik.rule: host(` dashboard.docker.localhost`)
      traefik.http.routers.traefik.entrypoints: web
      traefik.http.routers.traefik.tls: true
      traefik.http.routers.traefik.tls.certresolver: myresolver
      traefik.http.routers.service: api@internal

volumes:
  letsencrypt:
networks:
  web:

```

My service docker-compose file:

```auto
version: '2'
  services:
    whoami:
      image: containous/whoami
      labels:
        traefik.enable: true
        traefik.http.routers.whoami.rule: host(` whoami.docker.localhost`)
        traefik.http.routers.whoami.entrypoints: web
    networks:
    - web
networks:
  web:
    external: true

```

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [April 30, 2020, 11:32am UTC](https://community.traefik.io/t/gateway-timeout-when-traefik-and-app-in-separate-docker-compose-files/5821/2 "2020-04-30T11:32:14Z")

</div>

When you run compose it will create your items in a namespace(project). By default is is the name of the CWD(Current Working Directory).

If you run a `docker network ls` you will see this network as `projectname_web `.

You can resolve this in a few ways.

- Run `docker-compose` with a `-p name` flag to put them in the same namespace.
- Create your web network with a `name: web` option to explicitly name it
- Create the network yourself and use `external: true` on both compose files.
