Working docker-compose.yml file for creating the docker container

Fully working docker-compose file for creating the docker container for teddycloud.
Change the IPs to your network requirements.
The file was created with the infos from the telegram channel. Maybe it’s helpful for someone.

Greetings Matthias

docker-compose.yaml

version: '3'
services:
  teddycloud:
    container_name: teddycloud
    mac_address: 66-66-66-00-00-01  # random 
    #dns:                                                   
    #  - "192.168.178.1"
    # - "192.168.178.132" pi-hole adress
    networks:
      dockervlan:    
        ipv4_address: 192.168.178.138   # set your own IP-Adress 
    hostname: teddycloud
    domainname: fritz.box                       # set your own domain
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80 #optional
      - 443:443 #Port is needed for the connection for the box
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content 
      - library:/teddycloud/data/library
      - firmware:/teddycloud/data/firmware
    restart: unless-stopped
    environment:
     - TZ=Europe/Berlin
    cap_add:
      - NET_ADMIN

volumes:
  certs:
  config:
  content:
  library:
  firmware:
networks:
  dockervlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: eth0
    ipam: 
      config:
        - subnet: "192.168.178.0/24"      # change it to your own network address!
          ip_range: "192.168.178.100/26"  # change it to your own network address!
          gateway: "192.168.178.1"        # change it to your own network address!

3 Likes

Beware that this only works if your gateway is on 192.168.178.1 (fritz.box) and the named ip addresses are available.

you are right :slight_smile: changed it in the description…

This also works fine on a synology. You only have to replace eth0 by ovs_eth0.

One question: Could the following line get deleted?

ip_range: "192.168.178.100/26"  # change it to your own network address!

If you specify a IP for the container you should be able to remove the ip_range setting.

Hint: If you use DHCP in your network (like I am with my fritzbox) there is a setting in the fritzbox to see the range it sets there. When deploying dockercontainer on my macvlan network I give them IPs outside of the range (e.g. < .20) to not come into conflict with any dhcp assigned IPs.

For all who are using this composer file, showed above. be aware that you’re using container volumes. So when you delete them, everything is gone. I would recommend do mount real folders or nfs shares. (maybe next to the docker-compose.yaml)

as an example with my nfs config:

version: '3'
services:
  teddycloud:
    container_name: tc
    hostname: teddycloud
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - certs:/teddycloud/certs
      - config:/teddycloud/config
      - content:/teddycloud/data/content
      - lib:/teddycloud/data/library
    restart: unless-stopped
volumes:
  certs:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.179.3,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
        device: ":/volume2/Tonies/tc/certs"
  config:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.179.3,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
        device: ":/volume2/Tonies/tc/config"
  
  content:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.179.3,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
        device: ":/volume2/Tonies/tc/content"
  
  lib:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.179.3,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14,nfsvers=4
        device: ":/volume2/Tonies/tc/library"
  

or with local folders:

version: '3'
services:
  teddycloud:
    container_name: tc
    hostname: teddycloud
    image: ghcr.io/toniebox-reverse-engineering/teddycloud:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./certs:/teddycloud/certs
      - ./config:/teddycloud/config
      - ./content:/teddycloud/data/content
      - ./lib:/teddycloud/data/library
    restart: unless-stopped
3 Likes

If have the problem to connect to the webinterface while using the default docker-compose.yaml.
While doing some research I cam across this thread. Why this yaml so different to the default? Is setting up a VLAN required, or should the default yaml also work?

You don’t need VLAN to get it to work.
VLAN is only required if the needed ports are already in use

try uncommenting (erasing the #s) the lines ‘ports’, ‘80:80’ and ‘443:443’ in the example, you linked.

afterwards start it with ‘docker compose up’ (or append -d to run it in background > ‘docker compose up - d’ )

Ah, thanks. I forgot to uncomment the port forwarding.