Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and examples update for use with docker compose v2 #2201

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: mariadb:10.6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: mariadb:10.6
Expand Down
29 changes: 12 additions & 17 deletions .examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ events {
http {
include mime.types;
default_type application/octet-stream;
types {
text/javascript mjs;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
Expand All @@ -30,7 +33,7 @@ http {
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
default ", immutable";
}

#gzip on;
Expand Down Expand Up @@ -162,24 +165,16 @@ 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;
}
default_type "text/javascript";
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|svg|js|mjs|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";
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-XSS-Protection "1; mode=block" always;
access_log off; # Optional: Don't log access to assets

location ~ \.wasm$ {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: postgres:alpine
Expand Down Expand Up @@ -41,4 +39,4 @@ services:

volumes:
db:
nextcloud:
nextcloud:
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
version: '3'

services:
db:
image: postgres:alpine
restart: always
volumes:
- db:/var/lib/postgresql/data:z
- db:/var/lib/postgresql/data:Z
env_file:
- db.env

Expand Down
28 changes: 12 additions & 16 deletions .examples/docker-compose/insecure/postgres/fpm/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ events {
http {
include mime.types;
default_type application/octet-stream;
types {
text/javascript mjs;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
Expand All @@ -30,7 +33,7 @@ http {
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
default ", immutable";
}

#gzip on;
Expand Down Expand Up @@ -162,23 +165,16 @@ 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|svg|js|mjs|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";
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-XSS-Protection "1; mode=block" always;
access_log off; # Optional: Don't log access to assets

location ~ \.wasm$ {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: mariadb:10.6
Expand Down Expand Up @@ -34,6 +32,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
Expand All @@ -55,18 +57,21 @@ services:
- 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
- certs:/etc/nginx/certs:ro:z
- vhost.d:/etc/nginx/vhost.d:z
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- certs:/etc/nginx/certs:ro:z
- certs:/etc/nginx/certs:z,ro

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those :ro:z are still wrong

- html:/usr/share/nginx/html:z
- dhparam:/etc/nginx/dhparam:z
- /var/run/docker.sock:/tmp/docker.sock:z,ro
networks:
- proxy-tier

letsencrypt-companion:
image: nginxproxy/acme-companion
restart: always
environment:
- DEFAULT_EMAIL=
volumes:
- certs:/etc/nginx/certs:z
- acme:/etc/acme.sh:z
Expand Down Expand Up @@ -100,6 +105,7 @@ volumes:
acme:
vhost.d:
html:
dhparam:

networks:
proxy-tier:
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: mariadb:10.6
Expand Down Expand Up @@ -31,6 +29,7 @@ services:
depends_on:
- db
- redis
- proxy

web:
build: ./web
Expand Down Expand Up @@ -64,7 +63,7 @@ services:
- 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
Expand All @@ -76,6 +75,8 @@ services:
letsencrypt-companion:
image: nginxproxy/acme-companion
restart: always
environment:
- DEFAULT_EMAIL=
volumes:
- certs:/etc/nginx/certs:z
- acme:/etc/acme.sh:z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ events {
http {
include mime.types;
default_type application/octet-stream;
types {
text/javascript mjs;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
Expand All @@ -30,7 +33,7 @@ http {
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
default ", immutable";
}

#gzip on;
Expand Down Expand Up @@ -162,23 +165,16 @@ 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";
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-XSS-Protection "1; mode=block" always;
access_log off; # Optional: Don't log access to assets

location ~ \.wasm$ {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: postgres:alpine
Expand Down Expand Up @@ -29,6 +27,7 @@ services:
depends_on:
- db
- redis
- proxy
networks:
- proxy-tier
- default
Expand All @@ -50,9 +49,9 @@ services:
- 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
- certs:/etc/nginx/certs:ro:z
- vhost.d:/etc/nginx/vhost.d:z
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- certs:/etc/nginx/certs:ro:z
- certs:/etc/nginx/certs:ro,z

- html:/usr/share/nginx/html:z
- /var/run/docker.sock:/tmp/docker.sock:z,ro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
depends_on:
- db
- redis
- proxy

web:
build: ./web
Expand Down Expand Up @@ -59,7 +60,7 @@ services:
- 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
Expand All @@ -77,6 +78,8 @@ services:
- vhost.d:/etc/nginx/vhost.d:z
- html:/usr/share/nginx/html:z
- /var/run/docker.sock:/var/run/docker.sock:z,ro
environment:
- DEFAULT_EMAIL=
networks:
- proxy-tier
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ events {
http {
include mime.types;
default_type application/octet-stream;
types {
text/javascript mjs;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
Expand All @@ -30,7 +33,7 @@ http {
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
default ", immutable";
}

#gzip on;
Expand Down Expand Up @@ -162,23 +165,16 @@ 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|svg|js|mjs|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";
add_header Cache-Control "public, max-age=15778463$asset_immutable";
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header X-XSS-Protection "1; mode=block" always;
access_log off; # Optional: Don't log access to assets

location ~ \.wasm$ {
Expand Down
Loading
Loading