💾 Archived View for gemini.temperedtea.eu › technology › 20210510.gmi captured on 2023-01-29 at 03:15:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

Back

Nextcloud & docker-compose

With the upgrade to Nextcloud 21.0.1.1 my trusted docker-compose file, which I've been using for quite a while, suddenly stopped working.

docker exec -u www-data docker_conf_app_1 php occ status
  - installed: true
  - version: 21.0.1.1
  - versionstring: 21.0.1
  - edition: 

It cost me quite a few evenings together with my oldest son to get an idea of what went wrong - obviously, the way letsencrypt interacts with here with its components has changed in a non-backwards compatible way. To save you from losing as much time as we did, here without ado a docker-compose file that works for me - as usual, caveat emptor:

version: '3'

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

  redis:
    image: redis:alpine
    restart: always
      
  app:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html
      - acme:/etc/acme.sh
    environment:
      - VIRTUAL_HOST=MY_DOMAIN
      - LETSENCRYPT_HOST=MY_DOMAIN
      - LETSENCRYPT_EMAIL=my_email@MY_DOMAIN
      #- LETSENCRYPT_TEST=true
      - MYSQL_HOST=db
      - REDIS_HOST=redis
      - PHP_MEMORY_LIMIT=2G
      - PHP_UPLOAD_LIMIT=10G
    env_file:
      - db.env
    depends_on:
      - db
      - redis
      - letsencrypt-companion
    networks:
      - proxy-tier
      - default

  proxy:
    image: jwilder/nginx-proxy:alpine
    build: ./proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    volumes:
      - certs:/etc/nginx/certs:ro
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - nginx_conf.d:/etc/nginx/conf.d
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - acme:/etc/acme.sh
    networks:
      - proxy-tier

  letsencrypt-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    restart: always
    volumes:
      - certs:/etc/nginx/certs
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - acme:/etc/acme.sh
    networks:
      - proxy-tier
    depends_on:
      - proxy

volumes:
  db:
  nextcloud:
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: 'PATH/TO/NEXTCLOUD/DATA'
  certs:
  vhost.d:
  html:
  acme:
  nginx.conf.d:
  
networks:
  proxy-tier:

In addition, the new docker configurations doesn't set any more the client_max_body_size for the nginx proxy, resulting (at least for me) in error messages of the type "413 Request Entity Too Large".

docker exec -it [NAME OF YOUR PROXY CONTAINTER] bash

vi /etc/nginx/conf.d/uploadsize.conf
client_max_body_size 10000m;
client_body_buffer_size 400m;

Then restart the containers with docker-compose restart

One improvement I'd like to add one of these days is also to move the database volume to an external device.

Basis for my docker-compose file (last consulted 2021-05-04)

Nextcloud bug ticket that finally lead the way

413 Request Entity Too Large