Newer
Older
nextcloud / docker-compose.yml
version: '3'

services:
  nextcloud-app:
    image: pgollor/nextcloud:app-dev-latest
    restart: always
    cpus: 1.5
    depends_on:
      - nextcloud-database
      - nextcloud-redis
    env_file:
      - db.env
      - cloud.env
    environment:
      - MYSQL_HOST=db
      - MYSQL_DATABASE=cloud
      - MYSQL_USER=cloud
      - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
      - NEXTCLOUD_DATA_DIR=/srv/data
      - REDIS_HOST=nextcloudnextcloud-redis
      - TZ=${TZ}
    tmpfs:
      - /tmp
    links:
      - "nextcloud-database:db"
    volumes:
      - ./data/app:/var/www/html
      - ./data/data:/srv/data

  nextcloud-web:
    image: pgollor/nextcloud:web-latest
    restart: always
    logging:
      driver: json-file
    ports:
      - "${NEXTCLOUD_WEB_BIND:-127.0.0.1}:${NEXTCLOUD_WEB_PORT:-8080}:80"
    volumes:
      - ./data/app:/var/www/html:ro
    links:
      - "nextcloud-app:app"
    depends_on:
      - nextcloud-app

  nextcloud-database:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    environment:
      - MYSQL_DATABASE=cloud
      - MYSQL_USER=cloud
    env_file:
      - db.env
    volumes:
      -  nextcloud-db-vol-1:/var/lib/mysql/
      - ./data/conf/mysql:/etc/mysql/conf.d/:ro
    tmpfs:
      - /tmp

  nextcloud-redis:
    image: redis:alpine
    restart: always

  nextcloud-cron:
    image: nextcloud:fpm-alpine
    restart: always
    volumes:
      - ./data/app:/var/www/html
      - ./data/data:/srv/data
    logging:
      driver: json-file
    entrypoint: /cron.sh
    depends_on:
      - nextcloud-database
      - nextcloud-redis

volumes:
  nextcloud-db-vol-1: