-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextcloud-docker-compose.yml
62 lines (55 loc) · 1.83 KB
/
nextcloud-docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
version: '3'
services:
db:
image: postgres:alpine
restart: always
volumes:
- db:/var/lib/postgresql/data
env_file:
- db.env
networks:
- nextcloud
app:
image: nextcloud:apache
restart: always
# ports:
# - 8080:80
labels:
- traefik.enable=true
- traefik.docker.network=traefik
# http service and router for nextcloud
- traefik.http.routers.nextcloud_router_http.entryPoints=web
- traefik.http.routers.nextcloud_router_http.service=nextcloud_service_http
- traefik.http.routers.nextcloud_router_http.rule=Host("nextcloud.localhost")
- traefik.http.services.nextcloud_service_http.loadbalancer.server.port=80
# https service and router for nextcloud
- traefik.http.routers.nextcloud_router_https.entryPoints=websecure
- traefik.http.routers.nextcloud_router_https.rule=Host("nextcloud.localhost")
- traefik.http.routers.nextcloud_router_https.tls.certresolver=myresolver
- traefik.http.routers.nextcloud_router_https.tls=true
- traefik.http.services.nextcloud_service_https.loadbalancer.server.port=80
- traefik.http.routers.nextcloud_router_https.service=nextcloud_service_https
# permanent http to https redirect
- traefik.http.routers.nextcloud_router_http.middlewares=nextcloud_https_redirect
- traefik.http.middlewares.nextcloud_https_redirect.redirectscheme.scheme=https
- traefik.http.middlewares.nextcloud_https_redirect.redirectscheme.permanent=true
volumes:
- nextcloud:/var/www/html
environment:
- POSTGRES_HOST=db
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.localhost
env_file:
- db.env
depends_on:
- db
networks:
- traefik
- nextcloud
volumes:
db:
nextcloud:
networks:
traefik:
external:
name: traefik
nextcloud: