Docker Compose Pre-requisites

Hi guys,

EDIT 2: My problem still stands - I’d love to get a working version of docker-compose with the latest nextcloud:fpm and jrcs/letsencrypt-nginx-proxy-companion

EDIT: @Snowyo https://github.com/SnowMB/nextcloud solution and install.sh work for now. I needed to run initial start wizard with root ID for MySQL as it is a fork of https://github.com/indiehosters/nextcloud (based on v10)

server db:3306
db nextcloud
user root
passwd password

I was wondering which files and folders are needed to be created bore hand on the host VM? nginx.conf, php config? What am I missing?

I was following along the process with the official docker image and compose posted here: https://github.com/nextcloud/docker

This however doesn’t work as I was getting letsencrypt-companion container error. I think this was due missing a volume and folder for letsencrypt /.well-known/

Next I tried @Snowyo https://github.com/SnowMB/nextcloud and of course he kindly provided install.sh that created required .conf file and folder and this is the docker-compose that gets me the furthest.

Ideally I am looking just for these docker components:

  • nextcloud
  • letsencrypt
  • mysql

Below is the docker-compose.yml that I’d like to update

version: '2'


services:
  proxy:
    image: jwilder/nginx-proxy
    container_name: proxy
    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

#need to update this to jrcs/letsencrypt-nginx-proxy-companion, not sure how to use with docker-gen
  letsencrypt-companion:
    image: alastaircoote/docker-letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-companion
    volumes_from:
      - proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./proxy/certs:/etc/nginx/certs:rw
    environment:
      - LETSENCRYPT_TEST=TRUE


  web:
    image: nginx
    container_name: nextcloud_webserver
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
    volumes_from:
      - app
    environment:
      - VIRTUAL_HOST=${DOMAIN}
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=${DOMAIN}
      - LETSENCRYPT_EMAIL=${EMAIL}
      - ACME_CA_URI=https://acme-staging.api.letsencrypt.org/directory #using staging servers for dev/test
    networks:
      - proxy-tier

#need to update this to nextcloud:fpm as indiehosters is based on v10
  app:
    image: indiehosters/nextcloud
    container_name: nextcloud_fpm
    links:
      - db
    volumes:
      - ./nextcloud/apps:/var/www/html/apps
      - ./nextcloud/config:/var/www/html/config
      - ./nextcloud/data:/var/www/html/data
    networks:
      - proxy-tier
    
**#mysql credentials are set in .env file**
  db:
    image: mariadb
    container_name: db
    volumes:
      - ./nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PW}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=${MYSQL_USER_PW}
    networks:
      - proxy-tier

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