-
How does one proceed if it is desired to set a specific nextcloud-aio subnet? I have played around with creating a network in my docker compose:services:
all-in-one:
init: true
container_name: nextcloud-aio-mastercontainer
restart: always
ports:
- 8080:8080
networks: # added this
- nextcloud_network
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NEXTCLOUD_DATADIR=/srv/ncdata
- APACHE_PORT=11000
- APACHE_IP_BINDING=127.0.0.1
image: nextcloud/all-in-one:latest
networks: # and this
nextcloud_network:
ipam:
config:
- subnet: 172.25.0.0/16 # this is what im trying to get the nextcloud container to reside within
volumes:
nextcloud_aio_mastercontainer:
external: true
name: nextcloud_aio_mastercontainer But that creates a network with a different name than "nextcloud-aio" (name-of-compose+nextcloud_network), and keeps the previous nextcloud-aio network as is, meaning the ip of the nextcloudcontainer does not change.
The purpose of explicitly specifying a subnet is to allow the docker container to send mail to the host postfix (host postfix conf wants ip range, firewall rules, see for examle here), and so that the containers are easily moved to another host without needing to make new configurations (can keep configs).. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes
like so:
|
Beta Was this translation helpful? Give feedback.
Yes
like so: