10 Commits

Author SHA1 Message Date
  Robin Thoni 4ac1b8a62c README 4 years ago
  Robin Thoni 3ed42bc87a Modified Collabora env variables 4 years ago
  Robin Thoni 1293b8a6e0 Added TZ env variable 4 years ago
  Robin Thoni 4f86b1122b Ignore override test file 4 years ago
  Robin Thoni 13a8f6b56a Added Collabora 4 years ago
  Robin Thoni ec57693efa Fixed typos 4 years ago
  Robin Thoni c4f4cfd5c3 Renamed docker network 4 years ago
  Robin Thoni 3666dce728 Moved to nextcloud 16 4 years ago
  Robin Thoni 42ffde2a23 Moved to postgres 11 (official, no backup) 4 years ago
  Robin Thoni d5718e3186 Ignored idea files 4 years ago
9 changed files with 27 additions and 190 deletions
  1. 0
    2
      .gitignore
  2. 0
    142
      README.md
  3. 0
    1
      collabora/Dockerfile
  4. 16
    32
      docker-compose.yml
  5. 9
    7
      env
  6. 0
    4
      env_collabora
  7. 0
    1
      nextcloud/Dockerfile
  8. 1
    0
      owncloud/Dockerfile
  9. 1
    1
      postgresql/Dockerfile

+ 0
- 2
.gitignore View File

@@ -2,5 +2,3 @@
2 2
 *.swp
3 3
 env_override
4 4
 docker-compose.override.yml
5
-env_collabora_override
6
-.idea

+ 0
- 142
README.md View File

@@ -1,142 +0,0 @@
1
-## Abstract
2
-
3
-This docker-compose allows to easily run a Nextcloud instance with Collabora.
4
-
5
-## Prerequisites for production use
6
-
7
-- Domain records:
8
-  - One record for Nextcloud (eg: `nextcloud.example.com`)
9
-  - One record for Collabora (eg: `collabora.example.com`)
10
-  - BOTH records must be (resolvable AND accessible) from (Nextcloud container AND Collabora container AND final users)
11
-- HTTPS for Nextcloud and Collabora (eg: [Let’s Encrypt](https://letsencrypt.org/))
12
-- Reverse proxy for SSL termination
13
-
14
-## Installation
15
-
16
-### Tweak files
17
-
18
-- `env`
19
-  - Set `TZ`
20
-    - The timezone to be used in the container (See [List_of_tz_database_time_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones))
21
-    - Example: `Europe/Paris`
22
-  - Generate secure password for `POSTGRES_PASSWORD`
23
-    - Password to be set (and used) for the Nextcloud database user. It will only be set when postgres files (`./data/postgres/data/...`) are created. Any further change won't update it.
24
-    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
25
-  - Generate secure password for `NEXTCLOUD_ADMIN_PASSWORD`
26
-    - Password to be set for Nextcloud `root` user. It will only be set when Nextcloud will install itself. Any further change won't update it.
27
-    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
28
-
29
-- `env_collabora`
30
-  - Set `domain`
31
-    - Regexp for domain(s) allowed to used Collabora. It must match your Nextcloud domain.
32
-    - Example: `nextcloud\.example\.com` (Note the backslashes to escape the dots)
33
-  - Generate secure password for `password`
34
-    - Password to be set for Collabora admin panel (https://collabora.example.com/loleaflet/dist/admin/admin.html)
35
-    - Example: [passwordsgenerator.net](https://passwordsgenerator.net/)
36
-
37
-- `docker-compose.yml`
38
-  - Set restart policies
39
-    - Uncomment `restart` lines to allow docker to automatically start the containers on reboot.
40
-
41
-### Reverse proxy
42
-
43
-`/etc/apache2/sites-available/nextcloud.example.com.conf`:
44
-```
45
-<IfModule mod_ssl.c>
46
-    <VirtualHost *:80>
47
-        ServerName nextcloud.example.com
48
-        Redirect permanent / https://nextcloud.example.com/
49
-    </VirtualHost>
50
-    <VirtualHost *:443>
51
-        Include sites-available/nextcloud.example.com.include
52
-
53
-        SSLEngine on
54
-        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
55
-        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
56
-        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
57
-    </VirtualHost>
58
-</IfModule>
59
-<IfModule !mod_ssl.c>
60
-    <VirtualHost *:80>
61
-        Include sites-available/nextcloud.example.com.include
62
-    </VirtualHost>
63
-</IfModule>
64
-```
65
-
66
-`/etc/apache2/sites-available/nextcloud.example.com.include`:
67
-```
68
-ServerName nextcloud.example.com
69
-ServerAlias nextcloud.example.com
70
-ProxyPreserveHost On
71
-ProxyRequests off
72
-ProxyPass / http://127.0.0.1:35081/
73
-ProxyPassReverse / http://127.0.0.1:35081/
74
-
75
-```
76
-
77
-`/etc/apache2/sites-available/collabora.example.com.conf`:
78
-```
79
-<IfModule mod_ssl.c>
80
-    <VirtualHost *:80>
81
-        ServerName collabora.example.com
82
-        Redirect permanent / https://collabora.example.com/
83
-    </VirtualHost>
84
-    <VirtualHost *:443>
85
-        Include sites-available/collabora.example.com.include
86
-
87
-        SSLEngine on
88
-        SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
89
-        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
90
-        SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
91
-    </VirtualHost>
92
-</IfModule>
93
-<IfModule !mod_ssl.c>
94
-    <VirtualHost *:80>
95
-        Include sites-available/collabora.example.com.include
96
-    </VirtualHost>
97
-</IfModule>
98
-
99
-```
100
-
101
-`/etc/apache2/sites-available/collabora.example.com.include`:
102
-```
103
-ServerName collabora.example.com
104
-ServerAlias collabora.example.com
105
-ProxyPreserveHost On
106
-ProxyRequests off
107
-
108
-AllowEncodedSlashes NoDecode
109
-
110
-# Order of ProxyPass matters
111
-
112
-ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:35082/lool/$1/ws nocanon
113
-ProxyPass   /lool/adminws ws://127.0.0.1:35082/lool/adminws
114
-
115
-ProxyPass / http://127.0.0.1:35082/
116
-ProxyPassReverse / http://127.0.0.1:35082/
117
-
118
-```
119
-
120
-### Run
121
-
122
-```
123
-docker-compose up --build -d
124
-```
125
-
126
-### Install Nextcloud integration app
127
-
128
-- Login on Nextcloud with `root` account
129
-- Go to Upper right `account picture` / `Apps` / Upper right `search` icon
130
-- Type `Collabora Online`
131
-- Click `Download and enable`
132
-- Wait for installation to finish
133
-- Go to Upper right `account picture` / `Settings` / Lower left `Collabora Online`
134
-- Set your Collabora URL (eg: `https://collabora.example.com`)
135
-- Click `Apply`
136
-- Go back to Files
137
-- Click `+`
138
-- Click `New Document`
139
-- Type a name
140
-- Validate
141
-- Click the newly created document
142
-- Enjoy

+ 0
- 1
collabora/Dockerfile View File

@@ -1 +0,0 @@
1
-FROM collabora/code

+ 16
- 32
docker-compose.yml View File

@@ -3,53 +3,37 @@ version: '2'
3 3
 services:
4 4
     postgresql:
5 5
         build: ./postgresql
6
-        container_name: nextcloud-postgresql
6
+        container_name: owncloud-postgresql
7 7
 #        restart: unless-stopped
8 8
         networks:
9
-            main:
9
+            owncloud.internal.docker:
10 10
                 aliases:
11
-                    - postgresql.main.internal.docker
11
+                    - postgresql.owncloud.internal.docker
12 12
         volumes:
13 13
             - ./data/postgresql/data:/var/lib/postgresql/data
14
+            - ./data/postgresql/backup:/var/lib/postgresql/backup
14 15
         ports:
15
-            - "127.0.0.1:3580:5432"
16
+            - "127.0.0.1:35080:5432"
16 17
         env_file:
17 18
             - env
18 19
 
19
-    nextcloud:
20
-        build: ./nextcloud
21
-        container_name: nextcloud-nextcloud
20
+    owncloud:
21
+        build: ./owncloud
22
+        container_name: owncloud-owncloud
22 23
 #        restart: unless-stopped
23 24
         networks:
24
-            main:
25
+            owncloud.internal.docker:
25 26
                 aliases:
26
-                    - nextcloud.main.internal.docker
27
+                    - owncloud.owncloud.internal.docker
27 28
         volumes:
28
-            - ./data/nextcloud/apps:/var/www/html/apps
29
-            - ./data/nextcloud/config:/var/www/html/config
30
-            - ./data/nextcloud/data:/var/www/html/data
29
+            - ./data/owncloud/apps:/var/www/html/apps
30
+            - ./data/owncloud/config:/var/www/html/config
31
+            - ./data/owncloud/data:/var/www/html/data
31 32
         ports:
32
-            - "127.0.0.1:35081:80"
33
-        environment:
34
-          - POSTGRES_DB=nextcloud
33
+          #- "127.0.0.1:35081:80"
34
+            - "0.0.0.0:35081:80"
35 35
         env_file:
36 36
             - env
37 37
 
38
-    collabora:
39
-        build: ./collabora
40
-        container_name: nextcloud-collabora
41
-#        restart: unless-stopped
42
-        networks:
43
-            main:
44
-                aliases:
45
-                    - collabora.main.internal.docker
46
-        ports:
47
-            - "127.0.0.1:35082:9980"
48
-        cap_add:
49
-          - MKNOD
50
-        env_file:
51
-            - env
52
-            - env_collabora
53
-
54 38
 networks:
55
-    main:
39
+    owncloud.internal.docker:

+ 9
- 7
env View File

@@ -1,8 +1,10 @@
1
-TZ=Europe/London
2
-
3
-POSTGRES_USER=postgres
1
+POSTGRES_MASTER_MODE=1
2
+POSTGRES_HOST=postgresql.owncloud.internal.docker
3
+POSTGRES_USER=owncloud
4 4
 POSTGRES_PASSWORD=change_it
5
-POSTGRES_HOST=postgresql.main.internal.docker:5432
6
-
7
-NEXTCLOUD_ADMIN_USER=root
8
-NEXTCLOUD_ADMIN_PASSWORD=change_it
5
+POSTGRES_DB=owncloud
6
+POSTGRES_REP_USER=replicator
7
+POSTGRES_REP_PASSWORD=change_it
8
+POSTGRES_REP_ALLOWED_HOST=127.0.0.1/32
9
+POSTGRES_RO_USER=owncloud_ro
10
+POSTGRES_RO_PASSWORD=change_it

+ 0
- 4
env_collabora View File

@@ -1,4 +0,0 @@
1
-domain=collabora\.example\.com
2
-extra_params=--o:ssl.enable=false --o:ssl.termination=true
3
-username=root
4
-password=change_it

+ 0
- 1
nextcloud/Dockerfile View File

@@ -1 +0,0 @@
1
-FROM nextcloud:16.0-apache

+ 1
- 0
owncloud/Dockerfile View File

@@ -0,0 +1 @@
1
+FROM owncloud:10.0-apache

+ 1
- 1
postgresql/Dockerfile View File

@@ -1 +1 @@
1
-FROM postgres:11
1
+FROM robinthoni/postgres-backup-multiarch:9.6-1.1.0