Please help with NC on docker deployment

Hi NC experts,

i’d like to move off of a NC hosted on a VM to a NC instance on docker & been struggling to bring container up

I have a Ubuntu VM that is hosting already 10+ different containers and i’d like deploy NC on the same host, but i would like to use dedicated static IP, not just a port the IP for my NC would be 192.168.11.6 All other traffic (between NC and DB, would be internal to the host)

i used this to create my docker-compose.yml: https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml

this is my docker-compose.yml:

version: '3'

services:
  db:
    image: mariadb:10.5
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
    env_file:
      - db.env
    networks:
      - internal

  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:apache
    restart: always
        networks:
      vlan11_ext_net:
        ipv4_address:  192.168.11.6
      internal:   
    volumes:
      - ./nextcloud:/var/www/html
    environment:
      - MYSQL_HOST=db
      - REDIS_HOST=redis
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    image: nextcloud:apache
    restart: always
    volumes:
      - ./nextcloud:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

volumes:
  db:
  nextcloud:

networks:
  vlan11_ext_net:
    external: true
  internal:
    driver: bridge


i do have NGINX PRoxy Manager in front of NC, hosted on separate dmz vlan.

Do you see any issue with my config file?

the error i am getting is when i hit my IP is:


Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/lib/private/RedisFactory.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/lib/private/RedisFactory.php:124) in /var/www/html/lib/private/legacy/OC_Template.php on line 349
Internal Server Error The server encountered an internal error and was unable to complete your request. Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the server log. 

ideally this is what i am trying to accomplish is:

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚                      β”‚
                 β”‚           NPM in DMZ β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β”‚
                             β”‚
                             β”‚
                             β”‚
                             β”‚       192.168.11.5
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   docker host                                              β”‚
β”‚                                                            β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚    β”‚     β”‚ nextcloud app 192.168.11.6 - ext  β”‚       β”‚     β”‚
β”‚    β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚     β”‚
β”‚    β”‚                      β”‚                          β”‚     β”‚
β”‚    β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Ό      β”‚     β”‚
β”‚    β”‚          β”‚mariadb - internal net   β”‚            β”‚     β”‚
β”‚    β”‚          β”‚redis - internal         β”‚            β”‚     β”‚
β”‚    β”‚          β”‚                         β”‚            β”‚     β”‚
β”‚    β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚     β”‚
β”‚    β”‚                                                 β”‚     β”‚
β”‚    β”‚ NEXT CLOUD INSTANCE                             β”‚     β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

​

​

​

Hope this makes sense?
Can you please tell me why i am getting php/redis error or if my docker-compose could be improved
Thank you!

i feel i am so close …but so far away, this docker compose is working perfectly (so far). Just need to be able to use specific IP address instead of a port:

version: '3'

services:
  db:
    image: mariadb:10.5
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - ./nextcloud_db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=securepassword
    env_file:
      - db.env

  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:22.2.3-apache
    restart: always
    ports:
      - 8085:80
    volumes:
      - ./nextcloud:/var/www/html
      - ./data:/var/www/html/data # the actual data of NextCloud
      - ./config:/var/www/html/config #local configuration
      - ./custom_apps:/var/www/html/custom_apps # installed and custom apps
    environment:
      - MYSQL_HOST=db
      - REDIS_HOST=redis
      - APACHE_DISABLE_REWRITE_IP=1
      - TRUSTED_PROXIES=192.168.14.2/32
      - VIRTUAL_HOST=cloud.domain.com
      - NEXTCLOUD_TRUSTED_DOMAINS=domain.com


    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

volumes:
  db:
  nextcloud: