--- version: '3' volumes: nextcloud-data: nextcloud-db: networks: frontend: # add this if the network is already existing! # external: true backend: services: nextcloud-app: image: nextcloud restart: always volumes: - nextcloud-data:/var/www/html environment: - MYSQL_PASSWORD=replace-with-secure-password - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=nextcloud-db networks: - frontend - backend nextcloud-db: image: mariadb restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - nextcloud-db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=replace-with-secure-password - MYSQL_PASSWORD=replace-with-secure-password - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud networks: - backend