1

I have created two docker-compose files, the first one creates an nginx-proxy and a letsencrypt-nginx-proxy-companion. The other yaml-file creates a nextcloud instance (with mariadb). The first two containers start without an error and work, but after starting the second compose file, the following warning occurs:

Found orphan containers (test-proxy, test-letsencrypt) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

This are my compose files:

nginx-test.yml

version: '3.5' 

services:

  proxy:
    image: jwilder/nginx-proxy:alpine
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
    container_name: test-proxy
    networks:
      - testnet
    ports:
      - 80:80
      - 443:443
    volumes:
      - /srv/proxy/conf.d:/etc/nginx/conf.d:rw
      - /srv/proxy/vhost.d:/etc/nginx/vhost.d:rw
      - /srv/proxy/html:/usr/share/nginx/html:rw
      - /srv/proxy/certs:/etc/nginx/certs:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: unless-stopped

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: test-letsencrypt
    depends_on:
      - proxy
    networks:
      - testnet
    volumes:
      - /srv/proxy/certs:/etc/nginx/certs:rw
      - /srv/proxy/vhost.d:/etc/nginx/vhost.d:rw
      - /srv/proxy/html:/usr/share/nginx/html:rw
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

networks:
  testnet:

nextcloud-test.yml

version: '3.5' 

services:

  db:
    image: mariadb
    container_name: nextcloud-mariadb
    networks:
      - testnet
    volumes:
      - db:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=test
      - MYSQL_PASSWORD=test
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    restart: unless-stopped

  app:
    image: nextcloud:latest
    container_name: nextcloud-test
    networks:
      - testnet
    depends_on:
      - db
    volumes:
      - nextcloud:/var/www/html
      - /srv/nextcloud/config:/var/www/html/config
      - /srv/app/custom_apps:/var/www/html/custom_apps
      - /srv/app/data:/var/www/html/data
      - /srv/app/themes:/var/www/html/themes
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=nextcloud.localhost
      - LETSENCRYPT_HOST=nextcloud.localhost
      - LETSENCRYPT_EMAIL=test@test.com
    restart: unless-stopped

volumes:
  nextcloud:
  db:

networks:
  testnet:

If I start all four containers in one yml file, everything starts and I can access nextcloud at nextcloud.localhost. What should I change in my yml files so the four container could interact with each other?

elvenking
  • 11
  • 3
  • Each Docker-container file indicates one system "cluster". Are these meant to be in one cluster or two clusters? By cluster, I mean one or more web servers, db servers, etc. – Paul Jan 16 '20 at 22:33
  • The containers should be in one cluster, running on one vserver – elvenking Jan 17 '20 at 05:29
  • Then definitely keep them all in one compose file. The whole point of the compose file is to easily spin up your entire cluster. – Paul Jan 17 '20 at 05:43
  • Ok thank you, but what's then the solution to my original problem of splitting nginx and applications/services? If I want to add another application like gitlab in the future I have to stop all containers and bring everything back up with this configuration? – elvenking Jan 17 '20 at 06:14

0 Answers0