Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3"
- networks:
- proxy: #thats the network from before
- external: true
- nextcloud: #thats a new seperate, unexposed network that only exists for nextcloud and its database
- external: false
- volumes: #you can play around here. most people acctually create way more volumes but this workes out okay for me
- nextcloud:
- nextcloud-db:
- services:
- nextcloud-db: #your mariadb database
- image: mariadb:10.4.1-bionic
- container_name: nextcloud-mariadb
- networks:
- - nextcloud #as you can see, the db only needs to be running in the internal network
- volumes:
- - nextcloud-db:/var/lib/mysql
- - /etc/localtime:/etc/localtime:ro
- environment: #replace those with something secure
- - MYSQL_ROOT_PASSWORD=rootpw
- - MYSQL_PASSWORD=mysql
- - MYSQL_DATABASE=nextcloud
- - MYSQL_USER=nextcloud
- restart: unless-stopped
- nextcloud:
- image: nextcloud:15.0.2-apache
- depends_on:
- - nextcloud-db
- restart: unless-stopped
- volumes:
- - nextcloud:/var/www/html
- - /data/nextcloud:/var/www/html/data #here is the data is stored
- labels: #those are the lables required for traefik to work and do its magic
- - traefik.enable=true
- - traefik.frontend.rule=Host:nextcloud.yourdomain.tld
- - traefik.docker.network=proxy
- - traefik.port=80
- - traefik.protocol=http
- networks:
- - nextcloud
- - proxy #also has to run in the external network that traefik uses
Add Comment
Please, Sign In to add comment