Nextcloud avec docker-compose

18/12/2018

version: '3.3'
 
services:
  db: 
    image: postgres:11.1
    restart: always
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_USER=nextcloud-user
      - POSTGRES_DB=nextcloud-db
    volumes:
      - postgres-nextcloud:/var/lib/postgresql/data
    ports:
      - 5432:5432
 
  phpPgAdmin:
    container_name: phppgadmin
    image: jacksoncage/phppgadmin:latest
    environment:
      - POSTGRESQL_HOST=db
      - POSTGRESQL_PORT=5432
      - POSTGRESQL_DEFAULT_DB=nextcloud-db
      - POSTGRESQL_USER=nextcloud-user
      - POSTGRES_PASSWORD=password
    ports:
      - 8080:80
    links:
      - db
 
  nextcloud:
    image: nextcloud:15-apache
    restart: always
    ports:
      - 8081:80
    volumes:
      - nextcloud-nextcloud:/var/www/html
      - nextcloud-apps:/var/www/html/custom_apps
      - nextcloud-config:/var/www/html/config
      - nextcloud-data:/var/www/html/data
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=nextcloud-db
      - POSTGRES_USER=nextcloud-user
    depends_on:
      - db
    link:
      - db
 
volumes:
  postgres-nextcloud:
#    external: true
#    driver: nfs
  nextcloud-nextcloud:
#    external: true
#    driver: nfs
  nextcloud-apps:
#    external: true
#    driver: nfs
  nextcloud-config:
#    external: true
#    driver: nfs
  nextcloud-data:
#    external: true
#    driver: nfs