Advertisement
Guest User

docker-compose.yml

a guest
Jan 30th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.66 KB | None | 0 0
  1. version: "3"
  2.  
  3. networks:
  4.     proxy: //thats the network from before
  5.         external: true
  6.     nextcloud: //thats a new seperate, unexposed network that only exists for nextcloud and its database
  7.         external: false
  8.  
  9. volumes: #you can play around here. most people acctually create way more volumes but this workes out okay for me
  10.     nextcloud:
  11.     nextcloud-db:
  12.  
  13. services:  
  14.     nextcloud-db: #your mariadb database
  15.         image: mariadb:10.4.1-bionic
  16.         container_name: nextcloud-mariadb
  17.         networks:
  18.            - nextcloud //as you can see, the db only needs to be running in the internal network
  19.         volumes:
  20.            - nextcloud-db:/var/lib/mysql
  21.             - /etc/localtime:/etc/localtime:ro
  22.         environment: #replace those with something secure
  23.             - MYSQL_ROOT_PASSWORD=rootpw
  24.             - MYSQL_PASSWORD=mysql
  25.             - MYSQL_DATABASE=nextcloud
  26.             - MYSQL_USER=nextcloud
  27.         restart: unless-stopped
  28.    
  29.     nextcloud:
  30.         image: nextcloud:15.0.2-apache
  31.         depends_on:
  32.             - nextcloud-db
  33.         restart: unless-stopped
  34.         volumes:
  35.            - nextcloud:/var/www/html
  36.             - /data/nextcloud:/var/www/html/data #here is the data is stored
  37.         labels: //those are the lables required for traefik to work and do its magic
  38.             - traefik.enable=true
  39.             - traefik.frontend.rule=Host:nextcloud.yourdomain.tld
  40.             - traefik.docker.network=proxy
  41.             - traefik.port=80
  42.             - traefik.protocol=http
  43.         networks:
  44.            - nextcloud
  45.             - proxy //also has to run in the external network that traefik uses
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement