Docker compose file for SQLite installation

Hi. I run Docker with Portainer from an SSD on an RPi 4 (Argon One case). I use Manjaro minimal.

I want to use SQLite for my Nextcloud installation (low use, two person installation). Because the official Nextcloud image compose files (base version - apache) contains MariaDB lines I tried the linuxserver/nextcloud one, but it was broken and didn’t even start.

I wonder if someone could help me suggest how the compose file for the official image should be modified for SQLite only use.

I never tried but likely you just need to skip the DB container and add the filename for Sqlite…

from official docs:

Auto configuration via environment variables
The Nextcloud image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. To enable auto configuration, set your database connection via the following environment variables. You must specify all of the environment variables for a given database or the database environment variables defaults to SQLITE. ONLY use one database type!

SQLite:

  • SQLITE_DATABASE Name of the database using sqlite

Thanks! To be clear, here‘s the file that is referred to as “base version - apache”.

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.5
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

Are you saying I should do something like this:

version: '2'

volumes:
  nextcloud:

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    volumes:
      - nextcloud:/var/www/html
    environment:
      - SQLITE_DATABASE=db.sqlite

?