lamlion
6/28/2018 - 2:04 PM

nextcloud_nginx_letsencrypt_mariadb

nextcloud_nginx_letsencrypt_mariadb

version: '2'


services:
  nginx:
    image: jwilder/nginx-proxy
    container_name: nginx
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./proxy/conf.d:/etc/nginx/conf.d
      - ./proxy/vhost.d:/etc/nginx/vhost.d
      - ./proxy/html:/usr/share/nginx/html
      - ./proxy/certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy-tier

  letsencrypt-nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-companion
    depends_on: [nginx]
    volumes_from:
      - nginx
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./proxy/certs:/etc/nginx/certs:rw
    

  nextcloud:
    image: wonderfall/nextcloud
    container_name: nextcloud
    links:
      - db_nextcloud:db_nextcloud
    environment:
      - UID=1000
      - GID=1000
    volumes:
      - ./nextcloud/data:/data
      - ./nextcloud/config:/config
      - ./nextcloud/apps:/apps2
    environment:
      - VIRTUAL_HOST=
      - LETSENCRYPT_HOST=
      - LETSENCRYPT_EMAIL=
    depends_on:
      - letsencrypt-nginx-proxy-companion
    networks:
      - proxy-tier

  db_nextcloud:
    image: mariadb:10
    container_name: db_nextcloud
    volumes:
      - ./nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=ROOTPASSWORD
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=USERPASSWORD
    depends_on:
      - letsencrypt-nginx-proxy-companion
    networks:
      - proxy-tier


networks:
  proxy-tier:
    external:
      name: nginx-proxy