Docker Community Forums

Share and learn in the Docker community.

Issue with sub-domaining only on Docker-Compose but not the Docker cli. How do I configure docker-compose to allow wildcard subdomains?


(Nicolascoding) #1

Hello Docker forums! I posted this question over on stackoverflow, but I feel this may have been the more appropriate place to ask.

I am using Ubuntu 16.04, Docker version 1.13.1, build 092cba3

I have an application where we use the subdomain string to specify which team a customer belongs to.

For example:
customer1.ourdomain.com
customer2.ourdomain.com
… etc

Behind the scenes in our application we are parsing the string customerX from the origin URL to retrieve the customer’s appropriate data.

When I run a docker container from the cli without compose, like the below, I am able to connect to my container and have the expected behavior:

docker run -d -p 7000:7000 MyApplicationImage:latest   

However, when I try to access this same behavior through the means of the docker-compose.yaml:

docker stack deploy -c docker-compose.yaml MyApplication`

My browser will not connect and times out/hangs.

This is what my docker-compose.yaml file looks like as of right now:

version: "3"
    services:
        sone:
          image: MyApplicationImage:latest
          deploy:
            replicas: 1
            restart_policy:
              condition: on-failure
          ports:
           - "7000:7000"
          networks:
            - webnet
        stwo:
          image: myimagetwo:latest
          deploy:
            replicas: 1
            restart_policy:
              condition: on-failure
          ports:
            - "7001:7001"
          networks:
            - webnet
   networks:
      webnet:

(Pankajpippin) #2

Hi,

Same Situation here with SSL

We have https://www.domain.com running via nginx and api on same stack https://api.domain.com running via nodejs.

How to manage it on easy native way ?

Thanks