Docker Community Forums

Share and learn in the Docker community.

Docker compose + virtual host


(hugoliv) #1

Hey community,

I want to use docker-compose to manage few dockers:

I did manage the redirection without any problem. Could you please help me to understand why the subdomain moodle.domain.com reach the owncloud docker ?

Here is the docker-compose file used:

moodle:
image: sergiogomez/docker-moodle
environment:
 - VIRTUAL_HOST=moodle.domain.com
nginx:
image: jwilder/nginx-proxy:latest
 environment:
  - VIRTUAL_PROTO=https
  ports:
   - "443:443"
volumes:
 - /var/run/docker.sock:/tmp/docker.sock
 - /srv/docker/gitlab/gitlab/certs:/etc/nginx/certs
postgresql:
 image: sameersbn/postgresql:9.4
 volumes:
  - /srv/docker/gitlab/postgresql:/var/lib/postgresql
 gitlab:
  image: sameersbn/gitlab:latest
  links:
 - redis:redisio
 - postgresql:postgresql
 environment:
- VIRTUAL_HOST=gitlab.domain.com
volumes:
 - /srv/docker/gitlab/gitlab:/home/git/data
redis:
image: sameersbn/redis:latest
volumes:
 - /srv/docker/gitlab/redis:/var/lib/redis
owncloud:
 image: l3iggs/owncloud:latest
 environment:
 - VIRTUAL_HOST=cloud.domain.com
 - TARGET_SUBDIR=/
 volumes:
 - /srv/docker/owncloud/files:/usr/share/webapps/owncloud/data

(Jermorin) #2

I test exactly the same thing without success. I can not link a container on a particular subdomain. Do you have a solution?