meta data for this page
  •  

Docker Compose Cook Book

nextcloud

version: '2'

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
       - type: bind
         source: /srv/nextcloud/var/lib/mysql
         target: /var/lib/mysql

    environment:
      - MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
      - MYSQL_PASSWORD=$MYSQL_PASSWORD
      - MYSQL_DATABASE=$MYSQL_DATABASE
      - MYSQL_USER=$MYSQL_USER

  app:
    image: nextcloud:24.0-fpm
    restart: always
    links:
      - db
    volumes:
       - type: bind
         source: /srv/nextcloud/var/www/html
         target: /var/www/html    
    environment:
      - MYSQL_PASSWORD=$MYSQL_PASSWORD
      - MYSQL_DATABASE=$MYSQL_DATABASE
      - MYSQL_USER=$MYSQL_USER
      - MYSQL_HOST=db

  web:
    image: nginx
    restart: always
    ports:
      - 8080:80
    links:
      - app
    volumes:
       - type: bind
         source: /srv/nextcloud/etc/nginx/nginx.conf
         target: /etc/nginx/nginx.conf:ro
    volumes_from:
      - app