0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-06-15 15:54:47 +02:00

Update examples section according to the latest docker compose requirements.

Signed-off-by: Kaloyan Nikolov <tzerber@gmail.com>
This commit is contained in:
Kaloyan Nikolov 2024-04-18 16:30:37 +03:00 committed by J0WI
parent a1e93f429c
commit 6dc29f2a72
21 changed files with 675 additions and 148 deletions

View file

@ -1,10 +1,12 @@
version: '3'
services:
db:
image: mariadb:10.6
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
image: mariadb:10.8.2
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- db:/var/lib/mysql:Z
environment:
@ -21,6 +23,10 @@ services:
app:
image: nextcloud:apache
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html:z
environment:
@ -34,6 +40,10 @@ services:
depends_on:
- db
- redis
# Added proxy container dependency below.
# It is unclear on when or why it happens, but sometimes NC manages to start before the proxy
# and it breaks for whatever weird reason resulting in the need of manual proxy container restart.
- proxy
networks:
- proxy-tier
- default
@ -41,6 +51,10 @@ services:
cron:
image: nextcloud:apache
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html:z
entrypoint: /cron.sh
@ -51,15 +65,20 @@ services:
proxy:
build: ./proxy
restart: always
# Logging to syslog, it's best when combining with fail2ban on the host.
logging:
driver: "syslog"
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
volumes:
- certs:/etc/nginx/certs:z,ro
- conf.d:/etc/nginx/conf.d:z
- certs:/etc/nginx/certs:ro:z
- vhost.d:/etc/nginx/vhost.d:z
- html:/usr/share/nginx/html:z
- dhparam:/etc/nginx/dhparam:z
- /var/run/docker.sock:/tmp/docker.sock:z,ro
networks:
- proxy-tier
@ -67,9 +86,16 @@ services:
letsencrypt-companion:
image: nginxproxy/acme-companion
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
environment:
- DEFAULT_EMAIL=
volumes:
- certs:/etc/nginx/certs:z
- acme:/etc/acme.sh:z
- conf.d:/etc/nginx/conf.d:z
- vhost.d:/etc/nginx/vhost.d:z
- html:/usr/share/nginx/html:z
- /var/run/docker.sock:/var/run/docker.sock:z,ro
@ -100,6 +126,8 @@ volumes:
acme:
vhost.d:
html:
dhparam:
conf.d:
networks:
proxy-tier:

View file

@ -1,10 +1,12 @@
version: '3'
services:
db:
image: mariadb:10.6
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
image: mariadb:10.8.2
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- db:/var/lib/mysql:Z
environment:
@ -21,6 +23,10 @@ services:
app:
image: nextcloud:fpm-alpine
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html:z
environment:
@ -31,10 +37,15 @@ services:
depends_on:
- db
- redis
- proxy
web:
build: ./web
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html:z,ro
environment:
@ -50,6 +61,10 @@ services:
cron:
image: nextcloud:fpm-alpine
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
volumes:
- nextcloud:/var/www/html:z
entrypoint: /cron.sh
@ -60,14 +75,17 @@ services:
proxy:
build: ./proxy
restart: always
logging:
driver: "syslog"
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
volumes:
- certs:/etc/nginx/certs:z,ro
- vhost.d:/etc/nginx/vhost.d:z
- conf.d:/etc/nginx/conf.d:z
- html:/usr/share/nginx/html:z
- /var/run/docker.sock:/tmp/docker.sock:z,ro
networks:
@ -76,9 +94,16 @@ services:
letsencrypt-companion:
image: nginxproxy/acme-companion
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
environment:
- DEFAULT_EMAIL=
volumes:
- certs:/etc/nginx/certs:z
- acme:/etc/acme.sh:z
- conf.d:/etc/nginx/conf.d:z
- vhost.d:/etc/nginx/vhost.d:z
- html:/usr/share/nginx/html:z
- /var/run/docker.sock:/var/run/docker.sock:z,ro
@ -108,6 +133,7 @@ volumes:
certs:
acme:
vhost.d:
conf.d:
html:
networks:

View file

@ -1,3 +1,4 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY mime.types /etc/nginx/mime.types

View file

@ -0,0 +1,99 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
text/javascript mjs js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View file

@ -162,21 +162,8 @@ http {
fastcgi_max_temp_file_size 0;
}
# Javascript mimetype fixes for nginx
# Note: The block below should be removed, and the js|mjs section should be
# added to the block below this one. This is a temporary fix until Nginx
# upstream fixes the js mime-type
location ~* \.(?:js|mjs)$ {
types {
text/javascript js mjs;
}
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463, $asset_immutable";
access_log off;
}
# Serve static files
location ~ \.(?:css|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463, $asset_immutable";
access_log off; # Optional: Don't log access to assets