Hello guys, this is my first contribution to the community, hope it can be useful to you.
I’m been working at a little statement done in docker-compose file, where I used the following images:
- nextcloud:latest
- jrcs/letsencrypt-nginx-proxy-companion
- collabora/code
- mariadb
- jwilder/nginx-proxy:alpine
Diagram:
Below the Docker-compose.yml:
# for more information you can see the github pull below
# link: https://github.com/nextcloud/docker/pull/630/files
version: '3.8'
services:
proxy:
image: jwilder/nginx-proxy:alpine
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
container_name: nextcloud-proxy
networks:
- nextcloud_network
ports:
- 80:80
- 443:443
volumes:
- ./proxy/conf.d:/etc/nginx/conf.d:rw
- ./proxy/vhost.d:/etc/nginx/vhost.d:rw
- ./proxy/html:/usr/share/nginx/html:rw
- ./proxy/certs:/etc/nginx/certs:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nextcloud-letsencrypt
depends_on:
- proxy
networks:
- nextcloud_network
volumes:
- ./proxy/certs:/etc/nginx/certs:rw
- ./proxy/vhost.d:/etc/nginx/vhost.d:rw
- ./proxy/html:/usr/share/nginx/html:rw
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
db:
image: mariadb
container_name: nextcloud-mariadb
networks:
- nextcloud_network
volumes:
- db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=mypassword
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
restart: unless-stopped
app:
image: nextcloud:latest
container_name: nextcloud-app
networks:
- nextcloud_network
depends_on:
- letsencrypt
- proxy
- db
volumes:
- nextcloud:/var/www/html
- ./app/config:/var/www/html/config
- ./app/custom_apps:/var/www/html/custom_apps
- ./app/data:/var/www/html/data
- ./app/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
environment:
- VIRTUAL_HOST=app.domain.com
- LETSENCRYPT_HOST=app.domain.com
- LETSENCRYPT_EMAIL=example@com.com
restart: unless-stopped
collabora:
image: collabora/code
container_name: collabora
cap_add:
- MKNOD
environment:
- domain=example\\.domain\\.com
- VIRTUAL_HOST=offices.ydns.eu
- VIRTUAL_NETWORK=nginx-proxy
- extra_params=--o:ssl.enable=false --o:ssl.termination=true
- LETSENCRYPT_HOST=offices.domain.com
- LETSENCRYPT_EMAIL=example@com.com
- username=admin
- password=collabora
networks:
- nextcloud_network
restart: unless-stopped
volumes:
nextcloud:
db:
networks:
nextcloud_network: