How to add specific (existing) network to docker-compose.yml?

  • After a generous help of this community :thumbup: I managed to install letsencrypt and working nextcloud and airsonic containers. I'm using docker compose for it. For future installs, what line I have to include in yml file to join new containers to letsencrypt network? For example, if letsencrypt network ID is "23b23jb23j4v2hj34vhj2v3hjv23hj421jh44j23" what line I have to insert in calibre web docker-compose.yml:


    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • why don't you just add calibre to your existing docker-compose.yml? Then it's automatically joined in the network.


    Thank you for answer.


    That is OK for images from linuxserver.io. But I docker-compose.yml from developer (seafile) which is not from linuxserver and want to add to my letsencrypt network.


    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • As far as I know nothing stops you from adding all container to one docker-compose.yml regardless of the origin.
    But if you want to use separate files it's advisable to join your containers to a use created network.
    In cli you enter docker network create insert_name.
    In the docker-compose.yml you add

    Code
    networks:
    default:
    external:
    name: insert_name
  • Another problem
    I add calibre-web to my older nextcloud-mariadb-letsencrypt yml file and receive errors


    Code
    ERROR: for letsencrypt Cannot create container for service letsencrypt: Conflict. The container name "/letsencrypt" is already in use by container "9c62da18f85 82c75b404076fa0a96c5e9e396e95a1e60fb27ac3be79dc15b4d9". You have to remove (or rename) that container to be able to reuse that name.
    ERROR: for mariadb Cannot create container for service mariadb: Conflict. The container name "/nextclouddb" is already in use by container "762a3e86610d2c8bb8d 4145fd4aed8fd678b4b7cebf935f985b88e3b1a14e0c7". You have to remove (or rename) that container to be able to reuse that name.
    ERROR: Encountered errors while bringing up the project.

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

  • That's odd. I change nothing. Just add calibre-web to yml file. I run nextcloud-mariafb-letsencrypt file alone (w/o calibre-web lines) and everithing is ok:


    Code
    letsencrypt is up-to-date
    nextclouddb is up-to-date
    nextcloud is up-to-date

    = Fujitsu PRIMERGY TX1310 M3 • 2 x HDD 3.5" 4TB Western Digital Red • Windows Server 2019 • Hyper-V • OMV 5.x =

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!