Compare commits
479 Commits
3086c9db9b
...
6c1044fef4
Author | SHA1 | Date | |
---|---|---|---|
|
6c1044fef4 | ||
|
da5b3bed1f | ||
|
ac8c998431 | ||
|
4cd608a6e0 | ||
|
884d8c21a5 | ||
|
ac10481730 | ||
|
bf039fa5dd | ||
|
ce4af3ac34 | ||
|
4d9460c191 | ||
|
9a2dcf481c | ||
|
ddf60930f1 | ||
|
26487c056c | ||
|
4053ea4fb0 | ||
|
8c96d5b7ad | ||
|
4bd951c622 | ||
|
79c51bc316 | ||
|
03ec56e7b9 | ||
|
96c5d80121 | ||
|
08ea909b43 | ||
|
276de2c422 | ||
|
cef7ec58da | ||
|
c8fe9f3055 | ||
|
13be446667 | ||
|
fbdb70e856 | ||
|
15ea896496 | ||
|
e93b6a4251 | ||
|
d9ab30a969 | ||
|
b3f71af495 | ||
|
a3a21c2de7 | ||
|
3e474524d0 | ||
|
2a4b286de1 | ||
|
6353fe7bae | ||
|
0e24415434 | ||
|
0ea3f25d95 | ||
|
08916e2cc0 | ||
|
22dcc8e844 | ||
|
481072c892 | ||
|
1c23b49eae | ||
|
0ebad10363 | ||
|
88e6e3b9b2 | ||
|
f7a707aa8e | ||
|
0036beae18 | ||
|
f06bb9283a | ||
|
fe383374d4 | ||
|
d52c40b8f3 | ||
|
76dbb0bb6e | ||
|
f2489f0142 | ||
|
2ab02d446c | ||
|
fe5b6beadd | ||
|
269a081138 | ||
|
149daa299d | ||
|
6a173a4daa | ||
|
23b1488788 | ||
|
d5ecc2149f | ||
|
ec394822aa | ||
|
ce0bb40cd9 | ||
|
16e23e4081 | ||
|
cee1980750 | ||
|
8fac176f74 | ||
|
7eb00b62aa | ||
|
2680fb27ab | ||
|
f0762a282a | ||
|
15e6fcb316 | ||
|
6d007ebd0b | ||
|
a3ba284c78 | ||
|
1985c8235d | ||
|
8bc140d40f | ||
|
7b97c8a9c2 | ||
|
f165752597 | ||
|
5ed523117a | ||
|
c7143feda6 | ||
|
145652e70c | ||
|
1760450ac8 | ||
|
10a1fe7606 | ||
|
5ba119faba | ||
|
47e3572bcd | ||
|
0c1534a2a9 | ||
|
cc2952f6f5 | ||
|
7d0e49e5dd | ||
|
ba4fc2dcbb | ||
|
73ff5c860d | ||
|
892ac14791 | ||
|
e8e53f95c3 | ||
|
5804f506d8 | ||
|
b83f76cba0 | ||
|
e965a1a46c | ||
|
2cd569daef | ||
|
2acb1df9ae | ||
|
6db0941a3d | ||
|
ef9c3cb89c | ||
|
d56b4ed9c0 | ||
|
552a52afc0 | ||
|
7ec56a6567 | ||
|
6291898c2b | ||
|
a4efb0e686 | ||
|
060cf0883f | ||
|
66c5d81dbd | ||
|
c956cf7fa6 | ||
|
a8064a27f1 | ||
|
ea8fae60eb | ||
|
1d4be7e931 | ||
|
4df6f79568 | ||
|
1000d4d468 | ||
|
941daf6a0b | ||
|
c4e7afe079 | ||
|
8ba3f4f9bd | ||
|
b522064fe2 | ||
|
b7b542ea47 | ||
|
8231878052 | ||
|
147e2db921 | ||
|
f5665e1482 | ||
|
3f40b69c54 | ||
|
4a94550e2d | ||
|
ea5b853ab3 | ||
|
a87f914de3 | ||
|
df048873ab | ||
|
64607f4916 | ||
|
53bb46d1dc | ||
|
17a6790ac8 | ||
|
fc8952ab63 | ||
|
15e0c3bd3e | ||
|
001afbefb6 | ||
|
748d7873f3 | ||
|
a10a6ab7ee | ||
|
bae05a95f8 | ||
|
d2ccd7df04 | ||
|
6357f08f25 | ||
|
05073351c4 | ||
|
a1503cb4b0 | ||
|
724da9567e | ||
|
1012aa8527 | ||
|
991fc792ce | ||
|
04dbb09f12 | ||
|
5151f42e17 | ||
|
a9f8131e24 | ||
|
260de1e357 | ||
|
2fbd72c96d | ||
|
a2d0c57921 | ||
|
f0fd46a989 | ||
|
0578591681 | ||
|
343169d233 | ||
|
cde407bf5e | ||
|
c653d9b8a9 | ||
|
8680beee04 | ||
|
36744ae106 | ||
|
dc04397618 | ||
|
da36b3afe6 | ||
|
83ea69d54b | ||
|
45b1779c6f | ||
|
abe7b70052 | ||
|
7a96e8b5ad | ||
|
799db91fdf | ||
|
03cdaf2bee | ||
|
69ebdf0efd | ||
|
5317d8839e | ||
|
2af113afc6 | ||
|
d07e2166c4 | ||
|
09151270f2 | ||
|
30b2cb2706 | ||
|
ca34beed5e | ||
|
d54e368c1c | ||
|
a6bcddbac1 | ||
|
cd04baa73d | ||
|
c6f1569ebf | ||
|
9628a41081 | ||
|
fbc8d72cca | ||
|
85a2e86b6e | ||
|
da4cd779e3 | ||
|
0ae0a40b9f | ||
|
e3b5cade0f | ||
|
1997f8d584 | ||
|
6731d57690 | ||
|
d1840409e7 | ||
|
e670114004 | ||
|
6702c88033 | ||
|
d7671ab9cc | ||
|
ae8992ab62 | ||
|
a1ed54243d | ||
|
cbe0ad1ad2 | ||
|
f3186308e2 | ||
|
9c769f4ffc | ||
|
8791176d0a | ||
|
60622a729b | ||
|
b7e9458648 | ||
|
c98481a388 | ||
|
0b9f09e3e1 | ||
|
c0fd3fcd6d | ||
|
86c08c3769 | ||
|
deca4111fb | ||
|
71ddf2a868 | ||
|
e7405b7c16 | ||
|
768d2e620d | ||
|
6564b82fb0 | ||
|
532834349b | ||
|
77a5099fe9 | ||
|
3235cfeb09 | ||
|
2a7ac51730 | ||
|
7ac2798878 | ||
|
ecc897b477 | ||
|
5d607a706c | ||
|
a3763dfc15 | ||
|
e21fac2471 | ||
|
d9ca9e4b08 | ||
|
1091814e9b | ||
|
1f3c1cd4e9 | ||
|
643a35d6fb | ||
|
f9e1ef8537 | ||
|
908fb6a04f | ||
|
891feeaf94 | ||
|
4c0d269740 | ||
|
ae94e4a349 | ||
|
2e8205eef4 | ||
|
b5f659e6bd | ||
|
34a9a543e1 | ||
|
be19f23e61 | ||
|
f4929e6067 | ||
|
cc0564ed40 | ||
|
0a3d4aef87 | ||
|
b9ae3256ad | ||
|
6d7be410e0 | ||
|
2695fd9ba2 | ||
|
6b8820f3f5 | ||
|
cd72548651 | ||
|
da1192ed4c | ||
|
f2397fafc6 | ||
|
b0a5548d19 | ||
|
a726f805e3 | ||
|
bb10546327 | ||
|
184d54a2d6 | ||
|
e298a56eaa | ||
|
a8a7cb9571 | ||
|
f0f22d3ddf | ||
|
e0de4ab285 | ||
|
d3cd3b812f | ||
|
b3b6def923 | ||
|
2e481a86ee | ||
|
a9f458ce9f | ||
|
d1db681058 | ||
|
536fb66212 | ||
|
f2ee88d352 | ||
|
ba4c1359b9 | ||
|
250802c706 | ||
|
f081d3864d | ||
|
f3524791d9 | ||
|
15ab1ccecd | ||
|
b3d324f986 | ||
|
8d133d39e6 | ||
|
453a5224d9 | ||
|
d8d9a17be2 | ||
|
d06375a333 | ||
|
5f8fa19f04 | ||
|
e8e33356ff | ||
|
46c774cd8c | ||
|
57b9193096 | ||
|
11a6e69371 | ||
|
48f9b58e6f | ||
|
442510be73 | ||
|
06c299ce5b | ||
|
5bd47f8159 | ||
|
9ecaf51c4f | ||
|
2994c70264 | ||
|
5751ebc2a5 | ||
|
9ecb0fb6d9 | ||
|
70cb6ed262 | ||
|
ce614ef0d4 | ||
|
d3853330f5 | ||
|
4db869636b | ||
|
eed21207f1 | ||
|
89f64fe448 | ||
|
7d262cbf97 | ||
|
1999ee264b | ||
|
49085a33e6 | ||
|
e7d2df22ad | ||
|
0e941215b1 | ||
|
030a743b39 | ||
|
cb71d98f72 | ||
|
bd2e1b4107 | ||
|
31d7dedda9 | ||
|
a37b6752b9 | ||
|
2fb6c587dc | ||
|
2f90715d31 | ||
|
8bd688664d | ||
|
783232840a | ||
|
de2f3c57ee | ||
|
6467871d7a | ||
|
00387f5a7d | ||
|
25cc30e968 | ||
|
6619d53676 | ||
|
68f1f79be5 | ||
|
325dee46d1 | ||
|
fc2a691111 | ||
|
6e93ee37e6 | ||
|
817d74efba | ||
|
ceba099589 | ||
|
548306b919 | ||
|
b41d6dfd36 | ||
|
2c26edea97 | ||
|
8b7e80cb36 | ||
|
250b44903f | ||
|
9929de89d9 | ||
|
d6712dc1e9 | ||
|
44398e216a | ||
|
9bdddbfe47 | ||
|
28eb7826b2 | ||
|
0c16d10bf1 | ||
|
b4c914d530 | ||
|
aa5c0c1929 | ||
|
3a4a979f54 | ||
|
0213a9bd24 | ||
|
20ec8dbb8e | ||
|
ae849f1900 | ||
|
b6b83ba7ea | ||
|
4e76ae7c94 | ||
|
99d823806e | ||
|
0ebd883113 | ||
|
3f28ab64bd | ||
|
87413b7f4b | ||
|
64b3b2ae0f | ||
|
7914073ea2 | ||
|
d001a91815 | ||
|
7500500bae | ||
|
6c155c7ea2 | ||
|
3be7aee2db | ||
|
f16c857231 | ||
|
a7fe67e678 | ||
|
b95484b409 | ||
|
e431c13482 | ||
|
ab3b62bd10 | ||
|
2d22bcaba7 | ||
|
424364e2e1 | ||
|
b3df4606be | ||
|
f062435135 | ||
|
b25e1abe9c | ||
|
3838458843 | ||
|
1f4ffe722d | ||
|
3f931009c5 | ||
|
b8161a19a0 | ||
|
396cf35c97 | ||
|
63710a75a3 | ||
|
3770bbcb26 | ||
|
da31976a94 | ||
|
4d2dbd6ea0 | ||
|
7b7edd5f66 | ||
|
350a6eb644 | ||
|
4abd8b7d0e | ||
|
dc276645b9 | ||
|
9fced6721e | ||
|
529d4e743c | ||
|
37be10745f | ||
|
4adf0a9f39 | ||
|
31c0ec75df | ||
|
9719291632 | ||
|
8be067708c | ||
|
010f392951 | ||
|
0a18ad5c3e | ||
|
91adc66fae | ||
|
9f5b409962 | ||
|
6eb8f3fa16 | ||
|
aec153d69a | ||
|
a46493fbc4 | ||
|
de7204ccda | ||
|
9aaa473e7d | ||
|
efe4edb8eb | ||
|
5ce928c23b | ||
|
6b10932e81 | ||
|
dbadf5520b | ||
|
9681cf171b | ||
|
930a33b7be | ||
|
c9d875afb6 | ||
|
fca3a2f12d | ||
|
45bf61d190 | ||
|
bdc2d3e610 | ||
|
a3cce50b00 | ||
|
f5d3234fca | ||
|
69e982d7c7 | ||
|
f5d27c6153 | ||
|
7f485eb9fa | ||
|
eed144231e | ||
|
a31db79ae9 | ||
|
1a41584c28 | ||
|
f6abe4472b | ||
|
4549fd56a9 | ||
|
b72fbcfb04 | ||
|
61829178ab | ||
|
5bb0a7d7fb | ||
|
9435421b50 | ||
|
6124a1af14 | ||
|
e1b371d460 | ||
|
b784ac84ad | ||
|
35fd42d042 | ||
|
7b19d3c352 | ||
|
0feb06c098 | ||
|
b7b85cf197 | ||
|
d75368bbbd | ||
|
06e6a54011 | ||
|
6da6d063ef | ||
|
23ae40b44b | ||
|
97f66e6641 | ||
|
bc04997fee | ||
|
7dc465b999 | ||
|
cb8d4a7ed4 | ||
|
1654a164dc | ||
|
677134a7f9 | ||
|
71b4d891f8 | ||
|
76ca281e03 | ||
|
c82c9fb705 | ||
|
c2cb51c7a8 | ||
|
a33d46c03c | ||
|
63cde1e682 | ||
|
e4b29de140 | ||
|
1f67adcf94 | ||
|
c79c5a8883 | ||
|
bb4523958d | ||
|
323dc9034f | ||
|
989f6be2c4 | ||
|
aa9cd89b82 | ||
|
547abbdce7 | ||
|
52d7f2e334 | ||
|
68c731298e | ||
|
31878f1f57 | ||
|
20d8e0df8d | ||
|
328b7f334f | ||
|
5d79969947 | ||
|
654ddeae23 | ||
|
39d259adfc | ||
|
9586356008 | ||
|
e05e2f1dd7 | ||
|
4ce7ef03ba | ||
|
ff77d29974 | ||
|
7f91a3a233 | ||
|
4cefdbfb40 | ||
|
ffa7769319 | ||
|
c7092b7a93 | ||
|
14c290dfec | ||
|
cfa514bbd8 | ||
|
66fcf0ba1f | ||
|
b0c5b58f58 | ||
|
18c3e065f6 | ||
|
daf0e68aaf | ||
|
87dfa43082 | ||
|
bbc61b3165 | ||
|
9547740db1 | ||
|
ebfcbfb255 | ||
|
af3787d31d | ||
|
5ea9f6b612 | ||
|
26ccd170b0 | ||
|
c0708d7967 | ||
|
12c61283e0 | ||
|
2e1ea3384e | ||
|
1d9428d1db | ||
|
18c1f1f5b6 | ||
|
ccb09b16a6 | ||
|
65ee21367b | ||
|
b1aa2bdb40 | ||
|
8ac2fb92d2 | ||
|
2714a3cc74 | ||
|
f42c63ea48 | ||
|
54fd1cc8ec | ||
|
edada57b6e | ||
|
5ea40f130f | ||
|
826e90c2cb | ||
|
4d1f143f69 | ||
|
88648a256f | ||
|
3b8aa7062a | ||
|
cbd5bd17bc | ||
|
0d843dc3ca | ||
|
351ea1eef4 | ||
|
a4a6ee0d37 | ||
|
80dd587d84 | ||
|
5af0fda705 | ||
|
2ba0991533 | ||
|
e833d8a4b7 | ||
|
5c7ba18637 | ||
|
81e5468c73 | ||
|
7a5bf34195 | ||
|
85a7b1a6ba | ||
|
c07de51f8e | ||
|
64a531b428 | ||
|
7f611a569e |
@ -23,12 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
if ($autoconfig_enabled) {
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
|
||||||
|
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
|
||||||
|
}
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
17
.config/redis.config.php
Normal file
17
.config/redis.config.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('REDIS_HOST')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.distributed' => '\OC\Memcache\Redis',
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => getenv('REDIS_HOST'),
|
||||||
|
'password' => getenv('REDIS_HOST_PASSWORD'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_PORT') !== false) {
|
||||||
|
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
|
||||||
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
|
$CONFIG['redis']['port'] = 6379;
|
||||||
|
}
|
||||||
|
}
|
15
.config/smtp.config.php
Normal file
15
.config/smtp.config.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'mail_smtpmode' => 'smtp',
|
||||||
|
'mail_smtphost' => getenv('SMTP_HOST'),
|
||||||
|
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
|
||||||
|
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
|
||||||
|
'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),
|
||||||
|
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
|
||||||
|
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
|
||||||
|
'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '',
|
||||||
|
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
|
||||||
|
'mail_domain' => getenv('MAIL_DOMAIN'),
|
||||||
|
);
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
# Examples section
|
# Examples section
|
||||||
|
|
||||||
In this subfolders are some examples how to use the docker image. There are two sections:
|
In this subfolders are some examples how to use the docker image. There are two sections:
|
||||||
|
|
||||||
* [`dockerfiles`](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles)
|
* [`dockerfiles`](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles)
|
||||||
* [`docker-compose`](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose)
|
* [`docker-compose`](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose)
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ The Dockerfiles use the default images as base image and build on top of it.
|
|||||||
|
|
||||||
Example | Description
|
Example | Description
|
||||||
------- | -------
|
------- | -------
|
||||||
[cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed).
|
[cron](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron) | uses supervisor to run the cron job inside the container (so no extra container is needed). This image runs `supervisord` to start nextcloud and cron as two seperate processes inside the container.
|
||||||
[imap](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/imap) | adds dependencies required to authenticate users via imap
|
[imap](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/imap) | adds dependencies required to authenticate users via imap
|
||||||
[smb](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/smb) | adds dependencies required to use smb shares
|
[smb](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/smb) | adds dependencies required to use smb shares
|
||||||
[full](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/full) | adds dependencies for ALL optional packages and cron functionality via supervisor (as in the `cron` example Dockerfile).
|
[full](https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/full) | adds dependencies for ALL optional packages and cron functionality via supervisor (as in the `cron` example Dockerfile).
|
||||||
@ -21,49 +21,46 @@ Example | Description
|
|||||||
### full
|
### full
|
||||||
The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html).
|
The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html).
|
||||||
|
|
||||||
NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the 13th line of the Dockerfile.</br>
|
NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the appropriate line in the Dockerfile.
|
||||||
|
|
||||||
NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews)</br>
|
NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews)
|
||||||
|
|
||||||
NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors.</br>
|
NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors.
|
||||||
|
|
||||||
The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile.
|
The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile.
|
||||||
|
|
||||||
#### PHP Module bz2
|
#### PHP Module bz2
|
||||||
`docker-php-ext-install bz2` </br>
|
`docker-php-ext-install bz2`
|
||||||
|
|
||||||
#### PHP Module imagick
|
|
||||||
`apt install libmagickwand-dev` </br>
|
|
||||||
`pecl install imagick` </br>
|
|
||||||
`docker-php-ext-enable imagick` </br>
|
|
||||||
|
|
||||||
#### PHP Module imap
|
#### PHP Module imap
|
||||||
`apt install libc-client-dev libkrb5-dev` </br>
|
`apt install libc-client-dev libkrb5-dev`
|
||||||
`docker-php-ext-configure imap --with-kerberos --with-imap-ssl` </br>
|
`docker-php-ext-configure imap --with-kerberos --with-imap-ssl`
|
||||||
`docker-php-ext-install imap` </br>
|
`docker-php-ext-install imap`
|
||||||
|
|
||||||
#### PHP Module gmp
|
#### PHP Module gmp
|
||||||
`apt install libgmp3-dev` </br>
|
`apt install libgmp3-dev`
|
||||||
`docker-php-ext-install gmp` </br>
|
`docker-php-ext-install gmp`
|
||||||
|
|
||||||
#### PHP Module smbclient
|
#### PHP Module smbclient
|
||||||
`apt install smbclient libsmbclient-dev` </br>
|
`apt install smbclient libsmbclient-dev`
|
||||||
`pecl install smbclient` </br>
|
`pecl install smbclient`
|
||||||
`docker-php-ext-enable smbclient` </br>
|
`docker-php-ext-enable smbclient`
|
||||||
|
|
||||||
#### ffmpeg
|
#### ffmpeg
|
||||||
`echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list` </br>
|
`apt install ffmpeg`
|
||||||
`apt install ffmpeg` </br>
|
|
||||||
|
#### imagemagick SVG support
|
||||||
|
`apt install libmagickcore-6.q16-6-extra`
|
||||||
|
|
||||||
#### LibreOffice
|
#### LibreOffice
|
||||||
`apt install LibreOffice` </br>
|
`apt install libreoffice`
|
||||||
|
|
||||||
#### CRON via supervisor
|
#### CRON via supervisor
|
||||||
`apt install supervisor` </br>
|
`apt install supervisor`
|
||||||
`mkdir /var/log/supervisord /var/run/supervisord` </br>
|
`mkdir /var/log/supervisord /var/run/supervisord`
|
||||||
The following Dockerfile commands are also necessary for a sucessfull cron installation: </br>
|
The following Dockerfile commands are also necessary for a sucessfull cron installation:
|
||||||
`COPY supervisord.conf /etc/supervisor/supervisord.conf` </br>
|
`COPY supervisord.conf /etc/supervisor/supervisord.conf`
|
||||||
`CMD ["/usr/bin/supervisord"]` </br>
|
`CMD ["/usr/bin/supervisord"]`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -92,9 +89,12 @@ If you want to update your installation to a newer version of nextcloud, repeat
|
|||||||
|
|
||||||
### with-nginx-proxy
|
### with-nginx-proxy
|
||||||
The nginx proxy adds a proxy layer between nextcloud and the internet. The proxy is designed to serve multiple sites on the same host machine.
|
The nginx proxy adds a proxy layer between nextcloud and the internet. The proxy is designed to serve multiple sites on the same host machine.
|
||||||
|
|
||||||
The advantage in adding this layer is the ability to add a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling.
|
The advantage in adding this layer is the ability to add a container for [Let's Encrypt](https://letsencrypt.org/) certificate handling.
|
||||||
This combination of the [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) and [jrcs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers creates a fully automated https encryption of the nextcloud installation without worrying about certificate generation, validation or renewal.
|
This combination of the [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) and [jrcs/docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) containers creates a fully automated https encryption of the nextcloud installation without worrying about certificate generation, validation or renewal.
|
||||||
|
|
||||||
|
**This setup only works with a valid domain name on a server that is reachable from the internet.**
|
||||||
|
|
||||||
To use this example complete the following steps:
|
To use this example complete the following steps:
|
||||||
|
|
||||||
1. open `docker-compose.yml`
|
1. open `docker-compose.yml`
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
FROM nextcloud:apache
|
|
||||||
|
|
||||||
COPY redis.config.php /usr/src/nextcloud/config/redis.config.php
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -13,11 +13,11 @@ services:
|
|||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 8080:80
|
||||||
@ -25,6 +25,7 @@ services:
|
|||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_HOST=db
|
- MYSQL_HOST=db
|
||||||
|
- REDIS_HOST=redis
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -32,7 +33,7 @@ services:
|
|||||||
- redis
|
- redis
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
FROM nextcloud:fpm
|
|
||||||
|
|
||||||
COPY redis.config.php /usr/src/nextcloud/config/redis.config.php
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -13,16 +13,17 @@ services:
|
|||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_HOST=db
|
- MYSQL_HOST=db
|
||||||
|
- REDIS_HOST=redis
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -40,7 +41,7 @@ services:
|
|||||||
- app
|
- app
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -37,20 +36,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -62,14 +66,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -89,66 +97,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
@ -12,8 +12,8 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:fpm
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -37,20 +36,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -62,14 +66,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -89,66 +97,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
@ -2,15 +2,15 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:fpm
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -37,20 +36,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -62,14 +66,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -89,66 +97,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
MYSQL_PASSWORD=
|
||||||
|
MYSQL_DATABASE=nextcloud
|
||||||
|
MYSQL_USER=nextcloud
|
@ -0,0 +1,78 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mariadb
|
||||||
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=
|
||||||
|
env_file:
|
||||||
|
- db.env
|
||||||
|
|
||||||
|
app:
|
||||||
|
image: nextcloud:fpm-alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- nextcloud:/var/www/html
|
||||||
|
environment:
|
||||||
|
- MYSQL_HOST=db
|
||||||
|
env_file:
|
||||||
|
- db.env
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
web:
|
||||||
|
build: ./web
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- nextcloud:/var/www/html:ro
|
||||||
|
environment:
|
||||||
|
- VIRTUAL_HOST=
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
networks:
|
||||||
|
- proxy-tier
|
||||||
|
- default
|
||||||
|
|
||||||
|
proxy:
|
||||||
|
build: ./proxy
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
volumes:
|
||||||
|
- certs:/etc/nginx/certs:ro
|
||||||
|
- vhost.d:/etc/nginx/vhost.d
|
||||||
|
- html:/usr/share/nginx/html
|
||||||
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
|
networks:
|
||||||
|
- proxy-tier
|
||||||
|
depends_on:
|
||||||
|
- omgwtfssl
|
||||||
|
|
||||||
|
omgwtfssl:
|
||||||
|
image: paulczar/omgwtfssl
|
||||||
|
restart: "no"
|
||||||
|
volumes:
|
||||||
|
- certs:/certs
|
||||||
|
environment:
|
||||||
|
- SSL_SUBJECT=servhostname.local
|
||||||
|
- CA_SUBJECT=my@example.com
|
||||||
|
- SSL_KEY=/certs/servhostname.local.key
|
||||||
|
- SSL_CSR=/certs/servhostname.local.csr
|
||||||
|
- SSL_CERT=/certs/servhostname.local.crt
|
||||||
|
networks:
|
||||||
|
- proxy-tier
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db:
|
||||||
|
nextcloud:
|
||||||
|
certs:
|
||||||
|
vhost.d:
|
||||||
|
html:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
proxy-tier:
|
@ -0,0 +1,3 @@
|
|||||||
|
FROM jwilder/nginx-proxy:alpine
|
||||||
|
|
||||||
|
COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf
|
@ -0,0 +1,2 @@
|
|||||||
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
@ -0,0 +1,3 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
@ -0,0 +1,173 @@
|
|||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
set_real_ip_from 10.0.0.0/8;
|
||||||
|
set_real_ip_from 172.16.0.0/12;
|
||||||
|
set_real_ip_from 192.168.0.0/16;
|
||||||
|
real_ip_header X-Real-IP;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
upstream php-handler {
|
||||||
|
server app:9000;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
# Add headers to serve security related headers
|
||||||
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
|
# topic first.
|
||||||
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
|
#
|
||||||
|
# WARNING: Only add the preload option once you read about
|
||||||
|
# the consequences in https://hstspreload.org/. This option
|
||||||
|
# will add the domain to a hardcoded list that is shipped
|
||||||
|
# in all major browsers and getting removed from this list
|
||||||
|
# could take several months.
|
||||||
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Download-Options "noopen" always;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
location = /robots.txt {
|
||||||
|
allow all;
|
||||||
|
log_not_found off;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
|
location = /.well-known/carddav {
|
||||||
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /.well-known/caldav {
|
||||||
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
|
}
|
||||||
|
|
||||||
|
# set max upload size
|
||||||
|
client_max_body_size 10G;
|
||||||
|
fastcgi_buffers 64 4K;
|
||||||
|
|
||||||
|
# Enable gzip but do not remove ETag headers
|
||||||
|
gzip on;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_comp_level 4;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
||||||
|
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
||||||
|
|
||||||
|
# Uncomment if your server is build with the ngx_pagespeed module
|
||||||
|
# This module is currently not supported.
|
||||||
|
#pagespeed off;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
rewrite ^ /index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $path_info;
|
||||||
|
# fastcgi_param HTTPS on;
|
||||||
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
|
fastcgi_param front_controller_active true;
|
||||||
|
fastcgi_pass php-handler;
|
||||||
|
fastcgi_intercept_errors on;
|
||||||
|
fastcgi_request_buffering off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
|
try_files $uri/ =404;
|
||||||
|
index index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adding the cache control header for js, css and map files
|
||||||
|
# Make sure it is BELOW the PHP block
|
||||||
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
|
# Add headers to serve security related headers (It is intended to
|
||||||
|
# have those duplicated to the ones above)
|
||||||
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
|
# this topic first.
|
||||||
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
|
#
|
||||||
|
# WARNING: Only add the preload option once you read about
|
||||||
|
# the consequences in https://hstspreload.org/. This option
|
||||||
|
# will add the domain to a hardcoded list that is shipped
|
||||||
|
# in all major browsers and getting removed from this list
|
||||||
|
# could take several months.
|
||||||
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Download-Options "noopen" always;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Optional: Don't log access to assets
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
# Optional: Don't log access to other assets
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
FROM nextcloud:apache
|
|
||||||
|
|
||||||
COPY redis.config.php /usr/src/nextcloud/config/redis.config.php
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -13,11 +13,11 @@ services:
|
|||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
@ -26,6 +26,7 @@ services:
|
|||||||
- LETSENCRYPT_HOST=
|
- LETSENCRYPT_HOST=
|
||||||
- LETSENCRYPT_EMAIL=
|
- LETSENCRYPT_EMAIL=
|
||||||
- MYSQL_HOST=db
|
- MYSQL_HOST=db
|
||||||
|
- REDIS_HOST=redis
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -36,7 +37,7 @@ services:
|
|||||||
- default
|
- default
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
FROM nextcloud:fpm
|
|
||||||
|
|
||||||
COPY redis.config.php /usr/src/nextcloud/config/redis.config.php
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -13,16 +13,17 @@ services:
|
|||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: ./app
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_HOST=db
|
- MYSQL_HOST=db
|
||||||
|
- REDIS_HOST=redis
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -45,7 +46,7 @@ services:
|
|||||||
- default
|
- default
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
build: ./app
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -42,20 +41,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -67,14 +71,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -94,66 +102,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -12,8 +12,8 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:fpm
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -42,20 +41,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -67,14 +71,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -94,66 +102,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -2,15 +2,15 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres:alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- db.env
|
- db.env
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: nextcloud:fpm
|
image: nextcloud:fpm-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
- nextcloud:/var/www/html
|
||||||
|
@ -1 +1,2 @@
|
|||||||
client_max_body_size 10G;
|
client_max_body_size 10G;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
user www-data;
|
worker_processes auto;
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -42,20 +41,25 @@ http {
|
|||||||
# Add headers to serve security related headers
|
# Add headers to serve security related headers
|
||||||
# Before enabling Strict-Transport-Security headers please read into this
|
# Before enabling Strict-Transport-Security headers please read into this
|
||||||
# topic first.
|
# topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
|
# Remove X-Powered-By, which is an information leak
|
||||||
|
fastcgi_hide_header X-Powered-By;
|
||||||
|
|
||||||
|
# Path to the root of your installation
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
@ -67,14 +71,18 @@ http {
|
|||||||
# The following 2 rules are only needed for the user_webfinger app.
|
# The following 2 rules are only needed for the user_webfinger app.
|
||||||
# Uncomment it if you're planning to use this app.
|
# Uncomment it if you're planning to use this app.
|
||||||
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
|
||||||
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
|
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
|
||||||
# last;
|
|
||||||
|
# The following rule is only needed for the Social app.
|
||||||
|
# Uncomment it if you're planning to use this app.
|
||||||
|
#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
|
||||||
|
|
||||||
location = /.well-known/carddav {
|
location = /.well-known/carddav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /.well-known/caldav {
|
location = /.well-known/caldav {
|
||||||
return 301 $scheme://$host/remote.php/dav;
|
return 301 $scheme://$host:$server_port/remote.php/dav;
|
||||||
}
|
}
|
||||||
|
|
||||||
# set max upload size
|
# set max upload size
|
||||||
@ -94,66 +102,72 @@ http {
|
|||||||
#pagespeed off;
|
#pagespeed off;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^ /index.php$uri;
|
rewrite ^ /index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
# fastcgi_param HTTPS on;
|
# fastcgi_param HTTPS on;
|
||||||
#Avoid sending the security headers twice
|
|
||||||
|
# Avoid sending the security headers twice
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
|
||||||
|
# Enable pretty urls
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass php-handler;
|
fastcgi_pass php-handler;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
try_files $uri/ =404;
|
try_files $uri/ =404;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Adding the cache control header for js and css files
|
# Adding the cache control header for js, css and map files
|
||||||
# Make sure it is BELOW the PHP block
|
# Make sure it is BELOW the PHP block
|
||||||
location ~ \.(?:css|js|woff|svg|gif)$ {
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
add_header Cache-Control "public, max-age=15778463";
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
# Add headers to serve security related headers (It is intended to
|
# Add headers to serve security related headers (It is intended to
|
||||||
# have those duplicated to the ones above)
|
# have those duplicated to the ones above)
|
||||||
# Before enabling Strict-Transport-Security headers please read into
|
# Before enabling Strict-Transport-Security headers please read into
|
||||||
# this topic first.
|
# this topic first.
|
||||||
# add_header Strict-Transport-Security "max-age=15768000;
|
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
|
||||||
# includeSubDomains; preload;";
|
|
||||||
#
|
#
|
||||||
# WARNING: Only add the preload option once you read about
|
# WARNING: Only add the preload option once you read about
|
||||||
# the consequences in https://hstspreload.org/. This option
|
# the consequences in https://hstspreload.org/. This option
|
||||||
# will add the domain to a hardcoded list that is shipped
|
# will add the domain to a hardcoded list that is shipped
|
||||||
# in all major browsers and getting removed from this list
|
# in all major browsers and getting removed from this list
|
||||||
# could take several months.
|
# could take several months.
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header Referrer-Policy "no-referrer" always;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-Robots-Tag none;
|
add_header X-Download-Options "noopen" always;
|
||||||
add_header X-Download-Options noopen;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||||
|
add_header X-Robots-Tag "none" always;
|
||||||
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Optional: Don't log access to assets
|
# Optional: Don't log access to assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
try_files $uri /index.php$request_uri;
|
||||||
# Optional: Don't log access to other assets
|
# Optional: Don't log access to other assets
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ RUN apt-get update && apt-get install -y \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& mkdir /var/log/supervisord /var/run/supervisord
|
&& mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
|
10
.examples/dockerfiles/cron/fpm-alpine/Dockerfile
Normal file
10
.examples/dockerfiles/cron/fpm-alpine/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM nextcloud:fpm-alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache supervisor \
|
||||||
|
&& mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
22
.examples/dockerfiles/cron/fpm-alpine/supervisord.conf
Normal file
22
.examples/dockerfiles/cron/fpm-alpine/supervisord.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/var/log/supervisord/supervisord.log
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
childlogdir=/var/log/supervisord/
|
||||||
|
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||||
|
logfile_backups=10 ; number of backed up logfiles
|
||||||
|
loglevel=error
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php-fpm
|
||||||
|
|
||||||
|
[program:cron]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=/cron.sh
|
@ -5,6 +5,8 @@ RUN apt-get update && apt-get install -y \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& mkdir /var/log/supervisord /var/run/supervisord
|
&& mkdir /var/log/supervisord /var/run/supervisord
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
|
@ -1,24 +1,59 @@
|
|||||||
FROM nextcloud:apache
|
FROM nextcloud:apache
|
||||||
|
|
||||||
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
|
RUN set -ex; \
|
||||||
&& apt-get update && apt-get install -y \
|
\
|
||||||
supervisor \
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
libmagickwand-dev \
|
libmagickcore-6.q16-6-extra \
|
||||||
libgmp3-dev \
|
procps \
|
||||||
|
smbclient \
|
||||||
|
supervisor \
|
||||||
|
# libreoffice \
|
||||||
|
; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libbz2-dev \
|
||||||
libc-client-dev \
|
libc-client-dev \
|
||||||
libkrb5-dev \
|
libkrb5-dev \
|
||||||
smbclient \
|
|
||||||
libsmbclient-dev \
|
libsmbclient-dev \
|
||||||
# LibreOffice \
|
; \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
\
|
||||||
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
&& ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \
|
docker-php-ext-install \
|
||||||
&& docker-php-ext-install bz2 gmp imap \
|
bz2 \
|
||||||
&& pecl install imagick smbclient \
|
imap \
|
||||||
&& docker-php-ext-enable imagick smbclient \
|
; \
|
||||||
&& mkdir /var/log/supervisord /var/run/supervisord
|
pecl install smbclient; \
|
||||||
|
docker-php-ext-enable smbclient; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
RUN mkdir -p \
|
||||||
|
/var/log/supervisord \
|
||||||
|
/var/run/supervisord \
|
||||||
|
;
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
|
51
.examples/dockerfiles/full/fpm-alpine/Dockerfile
Normal file
51
.examples/dockerfiles/full/fpm-alpine/Dockerfile
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
FROM nextcloud:fpm-alpine
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache \
|
||||||
|
ffmpeg \
|
||||||
|
imagemagick \
|
||||||
|
procps \
|
||||||
|
samba-client \
|
||||||
|
supervisor \
|
||||||
|
# libreoffice \
|
||||||
|
;
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache --virtual .build-deps \
|
||||||
|
$PHPIZE_DEPS \
|
||||||
|
imap-dev \
|
||||||
|
krb5-dev \
|
||||||
|
libressl-dev \
|
||||||
|
samba-dev \
|
||||||
|
bzip2-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
|
docker-php-ext-install \
|
||||||
|
bz2 \
|
||||||
|
imap \
|
||||||
|
; \
|
||||||
|
pecl install smbclient; \
|
||||||
|
docker-php-ext-enable smbclient; \
|
||||||
|
\
|
||||||
|
runDeps="$( \
|
||||||
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
|
||||||
|
| tr ',' '\n' \
|
||||||
|
| sort -u \
|
||||||
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
|
)"; \
|
||||||
|
apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
|
||||||
|
apk del .build-deps
|
||||||
|
|
||||||
|
RUN mkdir -p \
|
||||||
|
/var/log/supervisord \
|
||||||
|
/var/run/supervisord \
|
||||||
|
;
|
||||||
|
|
||||||
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
22
.examples/dockerfiles/full/fpm-alpine/supervisord.conf
Normal file
22
.examples/dockerfiles/full/fpm-alpine/supervisord.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/var/log/supervisord/supervisord.log
|
||||||
|
pidfile=/var/run/supervisord/supervisord.pid
|
||||||
|
childlogdir=/var/log/supervisord/
|
||||||
|
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||||
|
logfile_backups=10 ; number of backed up logfiles
|
||||||
|
loglevel=error
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=php-fpm
|
||||||
|
|
||||||
|
[program:cron]
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
command=/cron.sh
|
@ -1,24 +1,59 @@
|
|||||||
FROM nextcloud:fpm
|
FROM nextcloud:fpm
|
||||||
|
|
||||||
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
|
RUN set -ex; \
|
||||||
&& apt-get update && apt-get install -y \
|
\
|
||||||
supervisor \
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
libmagickwand-dev \
|
libmagickcore-6.q16-6-extra \
|
||||||
libgmp3-dev \
|
procps \
|
||||||
|
smbclient \
|
||||||
|
supervisor \
|
||||||
|
# libreoffice \
|
||||||
|
; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libbz2-dev \
|
||||||
libc-client-dev \
|
libc-client-dev \
|
||||||
libkrb5-dev \
|
libkrb5-dev \
|
||||||
smbclient \
|
|
||||||
libsmbclient-dev \
|
libsmbclient-dev \
|
||||||
# LibreOffice \
|
; \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
\
|
||||||
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
&& ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \
|
docker-php-ext-install \
|
||||||
&& docker-php-ext-install bz2 gmp imap \
|
bz2 \
|
||||||
&& pecl install imagick smbclient \
|
imap \
|
||||||
&& docker-php-ext-enable imagick smbclient \
|
; \
|
||||||
&& mkdir /var/log/supervisord /var/run/supervisord
|
pecl install smbclient; \
|
||||||
|
docker-php-ext-enable smbclient; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
RUN mkdir -p \
|
||||||
|
/var/log/supervisord \
|
||||||
|
/var/run/supervisord \
|
||||||
|
;
|
||||||
|
|
||||||
CMD ["/usr/bin/supervisord"]
|
COPY supervisord.conf /
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE=1
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]
|
||||||
|
@ -1,7 +1,28 @@
|
|||||||
FROM nextcloud:apache
|
FROM nextcloud:apache
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN set -ex; \
|
||||||
&& apt-get install -y libc-client-dev libkrb5-dev \
|
\
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
\
|
||||||
&& docker-php-ext-install imap
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libc-client-dev \
|
||||||
|
libkrb5-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
|
docker-php-ext-install imap; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
22
.examples/dockerfiles/imap/fpm-alpine/Dockerfile
Normal file
22
.examples/dockerfiles/imap/fpm-alpine/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM nextcloud:fpm-alpine
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache --virtual .build-deps \
|
||||||
|
$PHPIZE_DEPS \
|
||||||
|
imap-dev \
|
||||||
|
krb5-dev \
|
||||||
|
libressl-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
|
docker-php-ext-install imap; \
|
||||||
|
\
|
||||||
|
runDeps="$( \
|
||||||
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
|
||||||
|
| tr ',' '\n' \
|
||||||
|
| sort -u \
|
||||||
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
|
)"; \
|
||||||
|
apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
|
||||||
|
apk del .build-deps
|
@ -1,7 +1,28 @@
|
|||||||
FROM nextcloud:fpm
|
FROM nextcloud:fpm
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN set -ex; \
|
||||||
&& apt-get install -y libc-client-dev libkrb5-dev \
|
\
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
\
|
||||||
&& docker-php-ext-install imap
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libc-client-dev \
|
||||||
|
libkrb5-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
|
||||||
|
docker-php-ext-install imap; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM nextcloud:apache
|
FROM nextcloud:apache
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y smbclient && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/*
|
||||||
|
3
.examples/dockerfiles/smb/fpm-alpine/Dockerfile
Normal file
3
.examples/dockerfiles/smb/fpm-alpine/Dockerfile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM nextcloud:fpm-alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache procps samba-client
|
@ -1,3 +1,3 @@
|
|||||||
FROM nextcloud:fpm
|
FROM nextcloud:fpm
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y smbclient && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y procps smbclient && rm -rf /var/lib/apt/lists/*
|
||||||
|
88
.travis.yml
88
.travis.yml
@ -1,42 +1,60 @@
|
|||||||
dist: trusty
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
services: docker
|
|
||||||
|
|
||||||
language: bash
|
language: bash
|
||||||
|
services: docker
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
# preload images to avoid timeouts in tests
|
||||||
|
before_install:
|
||||||
|
- docker pull mariadb:10
|
||||||
|
- docker pull postgres:11-alpine
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- git clone https://github.com/docker-library/official-images.git ~/official-images
|
- git clone https://github.com/docker-library/official-images.git ~/official-images
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- env | sort
|
- env | sort
|
||||||
|
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
|
||||||
- image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}"
|
- image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}"
|
||||||
- if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi
|
- if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- travis_retry docker build -t "$image" "${VERSION}/${VARIANT}"
|
- |
|
||||||
- ~/official-images/test/run.sh "$image"
|
(
|
||||||
- .travis/test-example-dockerfiles.sh "$image"
|
set -Eeuo pipefail
|
||||||
|
set -x
|
||||||
|
travis_retry docker build -t "$image" "${VERSION}/${VARIANT}"
|
||||||
|
travis_retry ~/official-images/test/run.sh "$image"
|
||||||
|
.travis/test-example-dockerfiles.sh "$image"
|
||||||
|
)
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- docker images
|
- docker images
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# https://github.com/docker-library/php/issues/822
|
||||||
|
allow_failures:
|
||||||
|
- env: VERSION=15.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=16.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=17.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=18.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=15.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=16.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=17.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=18.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=17.0-beta VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=18.0-beta VARIANT=apache ARCH=i386
|
||||||
include:
|
include:
|
||||||
- &test-scripts
|
- &test-scripts
|
||||||
stage: test scripts
|
stage: test scripts
|
||||||
env: SCRIPT=update.sh
|
env: SCRIPT=update.sh
|
||||||
sudo: false
|
|
||||||
services: []
|
services: []
|
||||||
install: skip
|
install: skip
|
||||||
before_script: skip
|
before_script: skip
|
||||||
script:
|
script:
|
||||||
- hash_before=$(git write-tree)
|
- hash_before=$(git write-tree)
|
||||||
- ./update.sh
|
- travis_retry ./update.sh
|
||||||
- bash -c "[[ $hash_before = $(git add -A && git write-tree) ]]"
|
- bash -c "[[ $hash_before = $(git add -A && git write-tree) ]]"
|
||||||
after_script: skip
|
after_script: skip
|
||||||
|
|
||||||
@ -46,18 +64,42 @@ jobs:
|
|||||||
- wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
|
- wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
|
||||||
- chmod +x "$HOME/bin/bashbrew"
|
- chmod +x "$HOME/bin/bashbrew"
|
||||||
script:
|
script:
|
||||||
- ./generate-stackbrew-library.sh
|
- travis_retry ./generate-stackbrew-library.sh
|
||||||
|
|
||||||
- stage: test images
|
- stage: test images
|
||||||
env: VERSION=12.0 VARIANT=fpm-alpine ARCH=amd64
|
env: VERSION=16.0-rc VARIANT=fpm-alpine ARCH=amd64
|
||||||
- env: VERSION=12.0 VARIANT=fpm-alpine ARCH=i386
|
- env: VERSION=16.0-rc VARIANT=fpm-alpine ARCH=i386
|
||||||
- env: VERSION=12.0 VARIANT=fpm ARCH=amd64
|
- env: VERSION=16.0-rc VARIANT=fpm ARCH=amd64
|
||||||
- env: VERSION=12.0 VARIANT=fpm ARCH=i386
|
- env: VERSION=16.0-rc VARIANT=fpm ARCH=i386
|
||||||
- env: VERSION=12.0 VARIANT=apache ARCH=amd64
|
- env: VERSION=16.0-rc VARIANT=apache ARCH=amd64
|
||||||
- env: VERSION=12.0 VARIANT=apache ARCH=i386
|
- env: VERSION=16.0-rc VARIANT=apache ARCH=i386
|
||||||
- env: VERSION=13.0 VARIANT=fpm-alpine ARCH=amd64
|
- env: VERSION=17.0-rc VARIANT=fpm-alpine ARCH=amd64
|
||||||
- env: VERSION=13.0 VARIANT=fpm-alpine ARCH=i386
|
- env: VERSION=17.0-rc VARIANT=fpm-alpine ARCH=i386
|
||||||
- env: VERSION=13.0 VARIANT=fpm ARCH=amd64
|
- env: VERSION=17.0-rc VARIANT=fpm ARCH=amd64
|
||||||
- env: VERSION=13.0 VARIANT=fpm ARCH=i386
|
- env: VERSION=17.0-rc VARIANT=fpm ARCH=i386
|
||||||
- env: VERSION=13.0 VARIANT=apache ARCH=amd64
|
- env: VERSION=17.0-rc VARIANT=apache ARCH=amd64
|
||||||
- env: VERSION=13.0 VARIANT=apache ARCH=i386
|
- env: VERSION=17.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=18.0-rc VARIANT=fpm-alpine ARCH=amd64
|
||||||
|
- env: VERSION=18.0-rc VARIANT=fpm-alpine ARCH=i386
|
||||||
|
- env: VERSION=18.0-rc VARIANT=fpm ARCH=amd64
|
||||||
|
- env: VERSION=18.0-rc VARIANT=fpm ARCH=i386
|
||||||
|
- env: VERSION=18.0-rc VARIANT=apache ARCH=amd64
|
||||||
|
- env: VERSION=18.0-rc VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=16.0 VARIANT=fpm-alpine ARCH=amd64
|
||||||
|
- env: VERSION=16.0 VARIANT=fpm-alpine ARCH=i386
|
||||||
|
- env: VERSION=16.0 VARIANT=fpm ARCH=amd64
|
||||||
|
- env: VERSION=16.0 VARIANT=fpm ARCH=i386
|
||||||
|
- env: VERSION=16.0 VARIANT=apache ARCH=amd64
|
||||||
|
- env: VERSION=16.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=17.0 VARIANT=fpm-alpine ARCH=amd64
|
||||||
|
- env: VERSION=17.0 VARIANT=fpm-alpine ARCH=i386
|
||||||
|
- env: VERSION=17.0 VARIANT=fpm ARCH=amd64
|
||||||
|
- env: VERSION=17.0 VARIANT=fpm ARCH=i386
|
||||||
|
- env: VERSION=17.0 VARIANT=apache ARCH=amd64
|
||||||
|
- env: VERSION=17.0 VARIANT=apache ARCH=i386
|
||||||
|
- env: VERSION=18.0 VARIANT=fpm-alpine ARCH=amd64
|
||||||
|
- env: VERSION=18.0 VARIANT=fpm-alpine ARCH=i386
|
||||||
|
- env: VERSION=18.0 VARIANT=fpm ARCH=amd64
|
||||||
|
- env: VERSION=18.0 VARIANT=fpm ARCH=i386
|
||||||
|
- env: VERSION=18.0 VARIANT=apache ARCH=amd64
|
||||||
|
- env: VERSION=18.0 VARIANT=apache ARCH=i386
|
||||||
|
@ -10,10 +10,9 @@ dirs=( "${dirs[@]%/}" )
|
|||||||
for dir in "${dirs[@]}"; do
|
for dir in "${dirs[@]}"; do
|
||||||
if [ -d "$dir/$VARIANT" ]; then
|
if [ -d "$dir/$VARIANT" ]; then
|
||||||
(
|
(
|
||||||
cd "$dir/$VARIANT"
|
cd "$dir/$VARIANT"
|
||||||
sed -ri -e 's/^FROM .*/FROM '"$image"'/g' 'Dockerfile'
|
sed -ri -e 's/^FROM .*/FROM '"$image"'/g' 'Dockerfile'
|
||||||
docker build -t "$image-$dir" .
|
docker build -t "$image-$dir" .
|
||||||
~/official-images/test/run.sh "$image-$dir"
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,34 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$autoconfig_enabled = false;
|
|
||||||
|
|
||||||
if (getenv('SQLITE_DATABASE')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "sqlite";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('SQLITE_DATABASE');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "mysql";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
|
||||||
$AUTOCONFIG["dbuser"] = getenv('MYSQL_USER');
|
|
||||||
$AUTOCONFIG["dbpass"] = getenv('MYSQL_PASSWORD');
|
|
||||||
$AUTOCONFIG["dbhost"] = getenv('MYSQL_HOST');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
} elseif (getenv('POSTGRES_DB') && getenv('POSTGRES_USER') && getenv('POSTGRES_PASSWORD') && getenv('POSTGRES_HOST')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "pgsql";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('POSTGRES_DB');
|
|
||||||
$AUTOCONFIG["dbuser"] = getenv('POSTGRES_USER');
|
|
||||||
$AUTOCONFIG["dbpass"] = getenv('POSTGRES_PASSWORD');
|
|
||||||
$AUTOCONFIG["dbhost"] = getenv('POSTGRES_HOST');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$autoconfig_enabled = false;
|
|
||||||
if (getenv('SQLITE_DATABASE')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "sqlite";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('SQLITE_DATABASE');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
}elseif (getenv('MYSQL_ROOT_PASSWORD') && getenv('MYSQL_ROOT_USER') && getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
|
||||||
$root_user = getenv('MYSQL_ROOT_USER');
|
|
||||||
$root_password = getenv('MYSQL_ROOT_PASSWORD');
|
|
||||||
$user = getenv('MYSQL_USER');
|
|
||||||
$password = getenv('MYSQL_PASSWORD');
|
|
||||||
$database = getenv('MYSQL_DATABASE');
|
|
||||||
$host = getenv('MYSQL_HOST');
|
|
||||||
// Erase root environment variables
|
|
||||||
putenv('MYSQL_ROOT_USER');
|
|
||||||
putenv('MYSQL_ROOT_PASSWORD');
|
|
||||||
// Create connection
|
|
||||||
$connection = new mysqli($host, $root_user, $root_password);
|
|
||||||
// Check connection
|
|
||||||
if ($connection->connect_error) {
|
|
||||||
die("Connection failed: " . $connection->connect_error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create database
|
|
||||||
$create_database = "CREATE DATABASE " .$database;
|
|
||||||
$create_user = "GRANT ALL PRIVILEGES ON " .$database. ".* TO '" .$user."'@'%' IDENTIFIED BY '" .$password. "';";
|
|
||||||
if ($connection->query($create_database) && $connection->query($create_user)) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "mysql";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
|
||||||
$AUTOCONFIG["dbuser"] = getenv('MYSQL_USER');
|
|
||||||
$AUTOCONFIG["dbpass"] = getenv('MYSQL_PASSWORD');
|
|
||||||
$AUTOCONFIG["dbhost"] = getenv('MYSQL_HOST');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
} else {
|
|
||||||
echo "Error creating database: " . $connection->error;
|
|
||||||
}
|
|
||||||
|
|
||||||
$connection->close();
|
|
||||||
|
|
||||||
} elseif (getenv('MYSQL_DATABASE') && getenv('MYSQL_USER') && getenv('MYSQL_PASSWORD') && getenv('MYSQL_HOST')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "mysql";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('MYSQL_DATABASE');
|
|
||||||
$AUTOCONFIG["dbuser"] = getenv('MYSQL_USER');
|
|
||||||
$AUTOCONFIG["dbpass"] = getenv('MYSQL_PASSWORD');
|
|
||||||
$AUTOCONFIG["dbhost"] = getenv('MYSQL_HOST');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
} elseif (getenv('POSTGRES_DB') && getenv('POSTGRES_USER') && getenv('POSTGRES_PASSWORD') && getenv('POSTGRES_HOST')) {
|
|
||||||
$AUTOCONFIG["dbtype"] = "pgsql";
|
|
||||||
$AUTOCONFIG["dbname"] = getenv('POSTGRES_DB');
|
|
||||||
$AUTOCONFIG["dbuser"] = getenv('POSTGRES_USER');
|
|
||||||
$AUTOCONFIG["dbpass"] = getenv('POSTGRES_PASSWORD');
|
|
||||||
$AUTOCONFIG["dbhost"] = getenv('POSTGRES_HOST');
|
|
||||||
$autoconfig_enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
$CONFIG = array (
|
|
||||||
'memcache.locking' => '\OC\Memcache\Redis',
|
|
||||||
'redis' => array(
|
|
||||||
'host' => 'redis',
|
|
||||||
'port' => 6379,
|
|
||||||
),
|
|
||||||
);
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# version_greater A B returns whether A > B
|
|
||||||
version_greater() {
|
|
||||||
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# return true if specified directory is empty
|
|
||||||
directory_empty() {
|
|
||||||
[ -z "$(ls -A "$1/")" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_as() {
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
su - www-data -s /bin/sh -c "$1"
|
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
installed_version="0.0.0.0"
|
|
||||||
if [ -f /var/www/html/version.php ]; then
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
|
||||||
|
|
||||||
if version_greater "$installed_version" "$image_version"; then
|
|
||||||
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if version_greater "$image_version" "$installed_version"; then
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
|
||||||
fi
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
rsync_options="-rlDog --chown www-data:root"
|
|
||||||
else
|
|
||||||
rsync_options="-rlD"
|
|
||||||
fi
|
|
||||||
rsync $rsync_options --delete --exclude /config/ --exclude /data/ --exclude /custom_apps/ --exclude /themes/ /usr/src/nextcloud/ /var/www/html/
|
|
||||||
|
|
||||||
for dir in config data custom_apps themes; do
|
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
|
||||||
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$installed_version" != "0.0.0.0" ]; then
|
|
||||||
run_as 'php /var/www/html/occ upgrade --no-app-disable'
|
|
||||||
|
|
||||||
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
|
||||||
echo "The following apps have beed disabled:"
|
|
||||||
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
|
||||||
rm -f /tmp/list_before /tmp/list_after
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
151
16.0-rc/apache/Dockerfile
Normal file
151
16.0-rc/apache/Dockerfile
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
|
FROM php:7.3-apache-buster
|
||||||
|
|
||||||
|
# entrypoint.sh and cron.sh dependencies
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
rsync \
|
||||||
|
bzip2 \
|
||||||
|
busybox-static \
|
||||||
|
; \
|
||||||
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
\
|
||||||
|
mkdir -p /var/spool/cron/crontabs; \
|
||||||
|
echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
|
||||||
|
|
||||||
|
# install the PHP extensions we need
|
||||||
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
libevent-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libldap2-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libmemcached-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libpq-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libmagickwand-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
libgmp-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
|
||||||
|
if [ ! -e /usr/include/gmp.h ]; then ln -s /usr/include/$debMultiarch/gmp.h /usr/include/gmp.h; fi;\
|
||||||
|
docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \
|
||||||
|
docker-php-ext-configure gmp --with-gmp="/usr/include/$debMultiarch"; \
|
||||||
|
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
|
||||||
|
docker-php-ext-install -j "$(nproc)" \
|
||||||
|
exif \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
ldap \
|
||||||
|
opcache \
|
||||||
|
pcntl \
|
||||||
|
pdo_mysql \
|
||||||
|
pdo_pgsql \
|
||||||
|
zip \
|
||||||
|
gmp \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
|
pecl install APCu-5.1.18; \
|
||||||
|
pecl install memcached-3.1.5; \
|
||||||
|
pecl install redis-4.3.0; \
|
||||||
|
pecl install imagick-3.4.4; \
|
||||||
|
\
|
||||||
|
docker-php-ext-enable \
|
||||||
|
apcu \
|
||||||
|
memcached \
|
||||||
|
redis \
|
||||||
|
imagick \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# set recommended PHP.ini settings
|
||||||
|
# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
|
||||||
|
RUN { \
|
||||||
|
echo 'opcache.enable=1'; \
|
||||||
|
echo 'opcache.interned_strings_buffer=8'; \
|
||||||
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
|
echo 'opcache.memory_consumption=128'; \
|
||||||
|
echo 'opcache.save_comments=1'; \
|
||||||
|
echo 'opcache.revalidate_freq=1'; \
|
||||||
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
|
\
|
||||||
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
\
|
||||||
|
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
||||||
|
\
|
||||||
|
mkdir /var/www/data; \
|
||||||
|
chown -R www-data:root /var/www; \
|
||||||
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
RUN a2enmod rewrite remoteip ;\
|
||||||
|
{\
|
||||||
|
echo RemoteIPHeader X-Real-IP ;\
|
||||||
|
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
|
||||||
|
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
|
||||||
|
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
|
||||||
|
} > /etc/apache2/conf-available/remoteip.conf;\
|
||||||
|
a2enconf remoteip
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_VERSION 16.0.9RC1
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
fetchDeps=" \
|
||||||
|
gnupg \
|
||||||
|
dirmngr \
|
||||||
|
"; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
|
\
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2 \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2.asc \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
|
||||||
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
|
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
|
||||||
|
gpgconf --kill all; \
|
||||||
|
rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
rm -rf /usr/src/nextcloud/updater; \
|
||||||
|
mkdir -p /usr/src/nextcloud/data; \
|
||||||
|
mkdir -p /usr/src/nextcloud/custom_apps; \
|
||||||
|
chmod +x /usr/src/nextcloud/occ; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY *.sh upgrade.exclude /
|
||||||
|
COPY config/* /usr/src/nextcloud/config/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["apache2-foreground"]
|
@ -23,12 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
if ($autoconfig_enabled) {
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
|
||||||
|
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
|
||||||
|
}
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
}
|
17
16.0-rc/apache/config/redis.config.php
Normal file
17
16.0-rc/apache/config/redis.config.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('REDIS_HOST')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.distributed' => '\OC\Memcache\Redis',
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => getenv('REDIS_HOST'),
|
||||||
|
'password' => getenv('REDIS_HOST_PASSWORD'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_PORT') !== false) {
|
||||||
|
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
|
||||||
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
|
$CONFIG['redis']['port'] = 6379;
|
||||||
|
}
|
||||||
|
}
|
15
16.0-rc/apache/config/smtp.config.php
Normal file
15
16.0-rc/apache/config/smtp.config.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'mail_smtpmode' => 'smtp',
|
||||||
|
'mail_smtphost' => getenv('SMTP_HOST'),
|
||||||
|
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
|
||||||
|
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
|
||||||
|
'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),
|
||||||
|
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
|
||||||
|
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
|
||||||
|
'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '',
|
||||||
|
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
|
||||||
|
'mail_domain' => getenv('MAIL_DOMAIN'),
|
||||||
|
);
|
||||||
|
}
|
152
16.0-rc/apache/entrypoint.sh
Executable file
152
16.0-rc/apache/entrypoint.sh
Executable file
@ -0,0 +1,152 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# version_greater A B returns whether A > B
|
||||||
|
version_greater() {
|
||||||
|
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# return true if specified directory is empty
|
||||||
|
directory_empty() {
|
||||||
|
[ -z "$(ls -A "$1/")" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
run_as() {
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
su -p www-data -s /bin/sh -c "$1"
|
||||||
|
else
|
||||||
|
sh -c "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
|
||||||
|
if [ -n "${REDIS_HOST+x}" ]; then
|
||||||
|
|
||||||
|
echo "Configuring Redis as session handler"
|
||||||
|
{
|
||||||
|
echo 'session.save_handler = redis'
|
||||||
|
# check if redis host is an unix socket path
|
||||||
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
|
fi
|
||||||
|
# check if redis password has been set
|
||||||
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
|
fi
|
||||||
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
installed_version="0.0.0.0"
|
||||||
|
if [ -f /var/www/html/version.php ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||||
|
fi
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
||||||
|
|
||||||
|
if version_greater "$installed_version" "$image_version"; then
|
||||||
|
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
|
echo "Initializing nextcloud $image_version ..."
|
||||||
|
if [ "$installed_version" != "0.0.0.0" ]; then
|
||||||
|
echo "Upgrading nextcloud from $installed_version ..."
|
||||||
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
||||||
|
fi
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
rsync_options="-rlDog --chown www-data:root"
|
||||||
|
else
|
||||||
|
rsync_options="-rlD"
|
||||||
|
fi
|
||||||
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
|
|
||||||
|
for dir in config data custom_apps themes; do
|
||||||
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||||
|
echo "Initializing finished"
|
||||||
|
|
||||||
|
#install
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
echo "New nextcloud instance"
|
||||||
|
|
||||||
|
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||||
|
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
|
||||||
|
fi
|
||||||
|
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
|
||||||
|
fi
|
||||||
|
|
||||||
|
install=false
|
||||||
|
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||||
|
echo "Installing with SQLite database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
|
||||||
|
install=true
|
||||||
|
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
|
||||||
|
echo "Installing with MySQL database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||||
|
install=true
|
||||||
|
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||||
|
echo "Installing with PostgreSQL database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||||
|
install=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$install" = true ]; then
|
||||||
|
echo "starting nextcloud installation"
|
||||||
|
max_retries=10
|
||||||
|
try=0
|
||||||
|
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||||
|
do
|
||||||
|
echo "retrying install..."
|
||||||
|
try=$((try+1))
|
||||||
|
sleep 10s
|
||||||
|
done
|
||||||
|
if [ "$try" -gt "$max_retries" ]; then
|
||||||
|
echo "installing of nextcloud failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
|
echo "setting trusted domains…"
|
||||||
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
|
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
||||||
|
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
||||||
|
NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "running web-based installer on first connect!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#upgrade
|
||||||
|
else
|
||||||
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
echo "The following apps have been disabled:"
|
||||||
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
5
16.0-rc/apache/upgrade.exclude
Normal file
5
16.0-rc/apache/upgrade.exclude
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/config/
|
||||||
|
/data/
|
||||||
|
/custom_apps/
|
||||||
|
/themes/
|
||||||
|
/version.php
|
126
16.0-rc/fpm-alpine/Dockerfile
Normal file
126
16.0-rc/fpm-alpine/Dockerfile
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
|
||||||
|
FROM php:7.3-fpm-alpine3.11
|
||||||
|
|
||||||
|
# entrypoint.sh and cron.sh dependencies
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache \
|
||||||
|
rsync \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
rm /var/spool/cron/crontabs/root; \
|
||||||
|
echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
|
||||||
|
|
||||||
|
# install the PHP extensions we need
|
||||||
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apk add --no-cache --virtual .build-deps \
|
||||||
|
$PHPIZE_DEPS \
|
||||||
|
autoconf \
|
||||||
|
freetype-dev \
|
||||||
|
icu-dev \
|
||||||
|
libevent-dev \
|
||||||
|
libjpeg-turbo-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libmemcached-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libzip-dev \
|
||||||
|
openldap-dev \
|
||||||
|
pcre-dev \
|
||||||
|
postgresql-dev \
|
||||||
|
imagemagick-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
gmp-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \
|
||||||
|
docker-php-ext-configure ldap; \
|
||||||
|
docker-php-ext-install -j "$(nproc)" \
|
||||||
|
exif \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
ldap \
|
||||||
|
opcache \
|
||||||
|
pcntl \
|
||||||
|
pdo_mysql \
|
||||||
|
pdo_pgsql \
|
||||||
|
zip \
|
||||||
|
gmp \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
|
pecl install APCu-5.1.18; \
|
||||||
|
pecl install memcached-3.1.5; \
|
||||||
|
pecl install redis-4.3.0; \
|
||||||
|
pecl install imagick-3.4.4; \
|
||||||
|
\
|
||||||
|
docker-php-ext-enable \
|
||||||
|
apcu \
|
||||||
|
memcached \
|
||||||
|
redis \
|
||||||
|
imagick \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
runDeps="$( \
|
||||||
|
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
|
||||||
|
| tr ',' '\n' \
|
||||||
|
| sort -u \
|
||||||
|
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
|
||||||
|
)"; \
|
||||||
|
apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
|
||||||
|
apk del .build-deps
|
||||||
|
|
||||||
|
# set recommended PHP.ini settings
|
||||||
|
# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
|
||||||
|
RUN { \
|
||||||
|
echo 'opcache.enable=1'; \
|
||||||
|
echo 'opcache.interned_strings_buffer=8'; \
|
||||||
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
|
echo 'opcache.memory_consumption=128'; \
|
||||||
|
echo 'opcache.save_comments=1'; \
|
||||||
|
echo 'opcache.revalidate_freq=1'; \
|
||||||
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
|
\
|
||||||
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
\
|
||||||
|
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
||||||
|
\
|
||||||
|
mkdir /var/www/data; \
|
||||||
|
chown -R www-data:root /var/www; \
|
||||||
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_VERSION 16.0.9RC1
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
apk add --no-cache --virtual .fetch-deps \
|
||||||
|
bzip2 \
|
||||||
|
gnupg \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2 \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2.asc \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
|
||||||
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
|
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
|
||||||
|
gpgconf --kill all; \
|
||||||
|
rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
rm -rf /usr/src/nextcloud/updater; \
|
||||||
|
mkdir -p /usr/src/nextcloud/data; \
|
||||||
|
mkdir -p /usr/src/nextcloud/custom_apps; \
|
||||||
|
chmod +x /usr/src/nextcloud/occ; \
|
||||||
|
apk del .fetch-deps
|
||||||
|
|
||||||
|
COPY *.sh upgrade.exclude /
|
||||||
|
COPY config/* /usr/src/nextcloud/config/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["php-fpm"]
|
@ -23,12 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
if ($autoconfig_enabled) {
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
|
||||||
|
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
|
||||||
|
}
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
}
|
17
16.0-rc/fpm-alpine/config/redis.config.php
Normal file
17
16.0-rc/fpm-alpine/config/redis.config.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('REDIS_HOST')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.distributed' => '\OC\Memcache\Redis',
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => getenv('REDIS_HOST'),
|
||||||
|
'password' => getenv('REDIS_HOST_PASSWORD'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_PORT') !== false) {
|
||||||
|
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
|
||||||
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
|
$CONFIG['redis']['port'] = 6379;
|
||||||
|
}
|
||||||
|
}
|
15
16.0-rc/fpm-alpine/config/smtp.config.php
Normal file
15
16.0-rc/fpm-alpine/config/smtp.config.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'mail_smtpmode' => 'smtp',
|
||||||
|
'mail_smtphost' => getenv('SMTP_HOST'),
|
||||||
|
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
|
||||||
|
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
|
||||||
|
'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),
|
||||||
|
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
|
||||||
|
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
|
||||||
|
'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '',
|
||||||
|
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
|
||||||
|
'mail_domain' => getenv('MAIL_DOMAIN'),
|
||||||
|
);
|
||||||
|
}
|
152
16.0-rc/fpm-alpine/entrypoint.sh
Executable file
152
16.0-rc/fpm-alpine/entrypoint.sh
Executable file
@ -0,0 +1,152 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# version_greater A B returns whether A > B
|
||||||
|
version_greater() {
|
||||||
|
[ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# return true if specified directory is empty
|
||||||
|
directory_empty() {
|
||||||
|
[ -z "$(ls -A "$1/")" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
run_as() {
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
su -p www-data -s /bin/sh -c "$1"
|
||||||
|
else
|
||||||
|
sh -c "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
|
||||||
|
if [ -n "${REDIS_HOST+x}" ]; then
|
||||||
|
|
||||||
|
echo "Configuring Redis as session handler"
|
||||||
|
{
|
||||||
|
echo 'session.save_handler = redis'
|
||||||
|
# check if redis host is an unix socket path
|
||||||
|
if [ "$(echo "$REDIS_HOST" | cut -c1-1)" = "/" ]; then
|
||||||
|
if [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
|
echo "session.save_path = \"unix://${REDIS_HOST}\""
|
||||||
|
fi
|
||||||
|
# check if redis password has been set
|
||||||
|
elif [ -n "${REDIS_HOST_PASSWORD+x}" ]; then
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}\""
|
||||||
|
else
|
||||||
|
echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\""
|
||||||
|
fi
|
||||||
|
} > /usr/local/etc/php/conf.d/redis-session.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
installed_version="0.0.0.0"
|
||||||
|
if [ -f /var/www/html/version.php ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
|
||||||
|
fi
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
|
||||||
|
|
||||||
|
if version_greater "$installed_version" "$image_version"; then
|
||||||
|
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if version_greater "$image_version" "$installed_version"; then
|
||||||
|
echo "Initializing nextcloud $image_version ..."
|
||||||
|
if [ "$installed_version" != "0.0.0.0" ]; then
|
||||||
|
echo "Upgrading nextcloud from $installed_version ..."
|
||||||
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
|
||||||
|
fi
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
rsync_options="-rlDog --chown www-data:root"
|
||||||
|
else
|
||||||
|
rsync_options="-rlD"
|
||||||
|
fi
|
||||||
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
|
|
||||||
|
for dir in config data custom_apps themes; do
|
||||||
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
|
||||||
|
echo "Initializing finished"
|
||||||
|
|
||||||
|
#install
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
echo "New nextcloud instance"
|
||||||
|
|
||||||
|
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
|
||||||
|
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
|
||||||
|
fi
|
||||||
|
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
|
||||||
|
fi
|
||||||
|
|
||||||
|
install=false
|
||||||
|
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||||
|
echo "Installing with SQLite database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
|
||||||
|
install=true
|
||||||
|
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
|
||||||
|
echo "Installing with MySQL database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||||
|
install=true
|
||||||
|
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||||
|
echo "Installing with PostgreSQL database"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||||
|
install=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$install" = true ]; then
|
||||||
|
echo "starting nextcloud installation"
|
||||||
|
max_retries=10
|
||||||
|
try=0
|
||||||
|
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||||
|
do
|
||||||
|
echo "retrying install..."
|
||||||
|
try=$((try+1))
|
||||||
|
sleep 10s
|
||||||
|
done
|
||||||
|
if [ "$try" -gt "$max_retries" ]; then
|
||||||
|
echo "installing of nextcloud failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||||
|
echo "setting trusted domains…"
|
||||||
|
NC_TRUSTED_DOMAIN_IDX=1
|
||||||
|
for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
|
||||||
|
DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||||
|
run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
|
||||||
|
NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "running web-based installer on first connect!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#upgrade
|
||||||
|
else
|
||||||
|
run_as 'php /var/www/html/occ upgrade'
|
||||||
|
|
||||||
|
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
|
||||||
|
echo "The following apps have been disabled:"
|
||||||
|
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
|
||||||
|
rm -f /tmp/list_before /tmp/list_after
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
5
16.0-rc/fpm-alpine/upgrade.exclude
Normal file
5
16.0-rc/fpm-alpine/upgrade.exclude
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/config/
|
||||||
|
/data/
|
||||||
|
/custom_apps/
|
||||||
|
/themes/
|
||||||
|
/version.php
|
143
16.0-rc/fpm/Dockerfile
Normal file
143
16.0-rc/fpm/Dockerfile
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
|
||||||
|
FROM php:7.3-fpm-buster
|
||||||
|
|
||||||
|
# entrypoint.sh and cron.sh dependencies
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
rsync \
|
||||||
|
bzip2 \
|
||||||
|
busybox-static \
|
||||||
|
; \
|
||||||
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
\
|
||||||
|
mkdir -p /var/spool/cron/crontabs; \
|
||||||
|
echo '*/15 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
|
||||||
|
|
||||||
|
# install the PHP extensions we need
|
||||||
|
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
|
||||||
|
RUN set -ex; \
|
||||||
|
\
|
||||||
|
savedAptMark="$(apt-mark showmanual)"; \
|
||||||
|
\
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
libevent-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libldap2-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libmemcached-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libpq-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libmagickwand-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
libgmp-dev \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
|
||||||
|
if [ ! -e /usr/include/gmp.h ]; then ln -s /usr/include/$debMultiarch/gmp.h /usr/include/gmp.h; fi;\
|
||||||
|
docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \
|
||||||
|
docker-php-ext-configure gmp --with-gmp="/usr/include/$debMultiarch"; \
|
||||||
|
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
|
||||||
|
docker-php-ext-install -j "$(nproc)" \
|
||||||
|
exif \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
ldap \
|
||||||
|
opcache \
|
||||||
|
pcntl \
|
||||||
|
pdo_mysql \
|
||||||
|
pdo_pgsql \
|
||||||
|
zip \
|
||||||
|
gmp \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
|
pecl install APCu-5.1.18; \
|
||||||
|
pecl install memcached-3.1.5; \
|
||||||
|
pecl install redis-4.3.0; \
|
||||||
|
pecl install imagick-3.4.4; \
|
||||||
|
\
|
||||||
|
docker-php-ext-enable \
|
||||||
|
apcu \
|
||||||
|
memcached \
|
||||||
|
redis \
|
||||||
|
imagick \
|
||||||
|
; \
|
||||||
|
\
|
||||||
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
||||||
|
apt-mark auto '.*' > /dev/null; \
|
||||||
|
apt-mark manual $savedAptMark; \
|
||||||
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
||||||
|
| awk '/=>/ { print $3 }' \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -r dpkg-query -S \
|
||||||
|
| cut -d: -f1 \
|
||||||
|
| sort -u \
|
||||||
|
| xargs -rt apt-mark manual; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# set recommended PHP.ini settings
|
||||||
|
# see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
|
||||||
|
RUN { \
|
||||||
|
echo 'opcache.enable=1'; \
|
||||||
|
echo 'opcache.interned_strings_buffer=8'; \
|
||||||
|
echo 'opcache.max_accelerated_files=10000'; \
|
||||||
|
echo 'opcache.memory_consumption=128'; \
|
||||||
|
echo 'opcache.save_comments=1'; \
|
||||||
|
echo 'opcache.revalidate_freq=1'; \
|
||||||
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
||||||
|
\
|
||||||
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
||||||
|
\
|
||||||
|
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
||||||
|
\
|
||||||
|
mkdir /var/www/data; \
|
||||||
|
chown -R www-data:root /var/www; \
|
||||||
|
chmod -R g=u /var/www
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
|
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_VERSION 16.0.9RC1
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
fetchDeps=" \
|
||||||
|
gnupg \
|
||||||
|
dirmngr \
|
||||||
|
"; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends $fetchDeps; \
|
||||||
|
\
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2 \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
|
||||||
|
curl -fsSL -o nextcloud.tar.bz2.asc \
|
||||||
|
"https://download.nextcloud.com/server/prereleases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
|
||||||
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
|
# gpg key from https://nextcloud.com/nextcloud.asc
|
||||||
|
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
|
||||||
|
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
|
||||||
|
gpgconf --kill all; \
|
||||||
|
rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
|
||||||
|
rm -rf /usr/src/nextcloud/updater; \
|
||||||
|
mkdir -p /usr/src/nextcloud/data; \
|
||||||
|
mkdir -p /usr/src/nextcloud/custom_apps; \
|
||||||
|
chmod +x /usr/src/nextcloud/occ; \
|
||||||
|
\
|
||||||
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY *.sh upgrade.exclude /
|
||||||
|
COPY config/* /usr/src/nextcloud/config/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["php-fpm"]
|
@ -23,12 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($autoconfig_enabled) {
|
if ($autoconfig_enabled) {
|
||||||
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: "";
|
if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
|
||||||
|
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
|
||||||
|
}
|
||||||
|
|
||||||
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
|
||||||
|
|
||||||
if (getenv('NEXTCLOUD_ADMIN_USER') && getenv('NEXTCLOUD_ADMIN_PASSWORD')) {
|
|
||||||
$AUTOCONFIG["adminlogin"] = getenv('NEXTCLOUD_ADMIN_USER');
|
|
||||||
$AUTOCONFIG["adminpass"] = getenv('NEXTCLOUD_ADMIN_PASSWORD');
|
|
||||||
}
|
|
||||||
}
|
}
|
17
16.0-rc/fpm/config/redis.config.php
Normal file
17
16.0-rc/fpm/config/redis.config.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('REDIS_HOST')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'memcache.distributed' => '\OC\Memcache\Redis',
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
'redis' => array(
|
||||||
|
'host' => getenv('REDIS_HOST'),
|
||||||
|
'password' => getenv('REDIS_HOST_PASSWORD'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (getenv('REDIS_HOST_PORT') !== false) {
|
||||||
|
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
|
||||||
|
} elseif (getenv('REDIS_HOST')[0] != '/') {
|
||||||
|
$CONFIG['redis']['port'] = 6379;
|
||||||
|
}
|
||||||
|
}
|
15
16.0-rc/fpm/config/smtp.config.php
Normal file
15
16.0-rc/fpm/config/smtp.config.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
if (getenv('SMTP_HOST') && getenv('MAIL_FROM_ADDRESS') && getenv('MAIL_DOMAIN')) {
|
||||||
|
$CONFIG = array (
|
||||||
|
'mail_smtpmode' => 'smtp',
|
||||||
|
'mail_smtphost' => getenv('SMTP_HOST'),
|
||||||
|
'mail_smtpport' => getenv('SMTP_PORT') ?: (getenv('SMTP_SECURE') ? 465 : 25),
|
||||||
|
'mail_smtpsecure' => getenv('SMTP_SECURE') ?: '',
|
||||||
|
'mail_smtpauth' => getenv('SMTP_NAME') && getenv('SMTP_PASSWORD'),
|
||||||
|
'mail_smtpauthtype' => getenv('SMTP_AUTHTYPE') ?: 'LOGIN',
|
||||||
|
'mail_smtpname' => getenv('SMTP_NAME') ?: '',
|
||||||
|
'mail_smtppassword' => getenv('SMTP_PASSWORD') ?: '',
|
||||||
|
'mail_from_address' => getenv('MAIL_FROM_ADDRESS'),
|
||||||
|
'mail_domain' => getenv('MAIL_DOMAIN'),
|
||||||
|
);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user