From 84d67e2bb37d188985cf08737ded9a752d467fc9 Mon Sep 17 00:00:00 2001 From: Gontier Julien Date: Sun, 18 Sep 2022 21:56:05 +0200 Subject: [PATCH 1/4] Improve nginx performance. Signed-off-by: Gontier Julien --- preset/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/preset/nginx.conf b/preset/nginx.conf index 5830bc8..9f043fc 100644 --- a/preset/nginx.conf +++ b/preset/nginx.conf @@ -22,6 +22,12 @@ events { } http { + # By default, multi-threading is disabled, so we enable it. + aio threads; + + # Even if it not really need, it always good practice to set it up. + charset utf-8; + # Includes mapping of file name extensions to MIME types of responses # and defines the default type. include /etc/nginx/mime.types; From 53122320ea9963a77e9a9e8a9ffbaab7fc4586b0 Mon Sep 17 00:00:00 2001 From: Gontier Julien Date: Sun, 18 Sep 2022 21:57:08 +0200 Subject: [PATCH 2/4] whitespace Signed-off-by: Gontier Julien --- preset/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preset/nginx.conf b/preset/nginx.conf index 9f043fc..d28864c 100644 --- a/preset/nginx.conf +++ b/preset/nginx.conf @@ -26,7 +26,7 @@ http { aio threads; # Even if it not really need, it always good practice to set it up. - charset utf-8; + charset utf-8; # Includes mapping of file name extensions to MIME types of responses # and defines the default type. From 8a5e9ef5c3c81dbe95ecf1016300cb5d96174eca Mon Sep 17 00:00:00 2001 From: Snow <52894530+Gontier-Julien@users.noreply.github.com> Date: Sun, 18 Sep 2022 22:38:32 +0200 Subject: [PATCH 3/4] Change to the official images for syncthing and nginx to the alpine images. (#1) * Change to the official images for syncthing and nginx to the alpine images. Signed-off-by: Gontier Julien * Add .gitignore Signed-off-by: Gontier Julien Signed-off-by: Gontier Julien --- .gitignore | 3 +++ docker-compose-tunnels.yml | 8 ++++---- docker-compose.yml | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47dc69a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +http-root/ +data/ +.env \ No newline at end of file diff --git a/docker-compose-tunnels.yml b/docker-compose-tunnels.yml index e6c8a8a..553ea0a 100644 --- a/docker-compose-tunnels.yml +++ b/docker-compose-tunnels.yml @@ -1,6 +1,7 @@ version: "3.7" services: nginx: + image: nginx:mainline-alpine container_name: nginx restart: ${RESTART:-unless-stopped} hostname: ${DOMAIN_NAME:?err} @@ -8,10 +9,9 @@ services: - './http-root:/var/lib/nginx/html/http-root:ro' - './preset/nginx.conf:/etc/nginx/nginx.conf:ro' - './preset/conf.d-tunnels:/etc/nginx/conf.d:ro' - image: nginx syncthing: - image: linuxserver/syncthing + image: syncthing/syncthing:latest container_name: syncthing hostname: ${DOMAIN_NAME:?err} environment: @@ -19,7 +19,7 @@ services: - PGID=1000 - TZ=Europe/London volumes: - - './data/syncthing:/config' + - './data/syncthing:/var/syncthing/config' - './http-root/chaotic-aur:/repo' ports: - '127.0.0.1:8384:8384' @@ -29,7 +29,7 @@ services: restart: ${RESTART:-unless-stopped} cloudflared: - image: erisamoe/cloudflared + image: erisamoe/cloudflared:latest container_name: cloudflared command: --origincert /root/.cloudflared/cert.pem tunnel run --url http://nginx ${DOMAIN_NAME:?err} restart: ${RESTART:-unless-stopped} diff --git a/docker-compose.yml b/docker-compose.yml index 8e4fad4..8d3bc40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: "3.7" services: nginx: + image: nginx:mainline-alpine container_name: nginx restart: ${RESTART:-unless-stopped} hostname: ${DOMAIN_NAME:?err} @@ -17,10 +18,9 @@ services: ports: - '80:80' - '443:443' - image: nginx syncthing: - image: linuxserver/syncthing + image: syncthing/syncthing:latest container_name: syncthing hostname: ${DOMAIN_NAME:?err} environment: @@ -28,7 +28,7 @@ services: - PGID=1000 - TZ=Europe/London volumes: - - './data/syncthing:/config' + - './data/syncthing:/var/syncthing/config' - './http-root/chaotic-aur:/repo' ports: - '127.0.0.1:8384:8384' @@ -38,11 +38,11 @@ services: restart: ${RESTART:-unless-stopped} certbot: + image: certbot/certbot:${LETSENCRYPT_TAG:-latest} container_name: certbot restart: ${RESTART:-unless-stopped} volumes: - './data/acme-webroot:/srv/http/webroot' - './data/letsencrypt/etc:/etc/letsencrypt' - './data/letsencrypt/var:/var/lib/letsencrypt' - image: certbot/certbot:${LETSENCRYPT_TAG:-latest} entrypoint: "/bin/sh -c 'trap exit TERM; sleep 10; while :; do certbot renew -w /srv/http/webroot/ --webroot; sleep 12h & wait $${!}; done;'" From 444305b2475b953766794348bfa3fb1184f505bb Mon Sep 17 00:00:00 2001 From: Gontier Julien Date: Sun, 18 Sep 2022 19:17:52 +0200 Subject: [PATCH 4/4] Not needed anymore with the official image. Signed-off-by: Gontier Julien --- docker-compose-tunnels.yml | 1 - docker-compose.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/docker-compose-tunnels.yml b/docker-compose-tunnels.yml index 553ea0a..3e0d384 100644 --- a/docker-compose-tunnels.yml +++ b/docker-compose-tunnels.yml @@ -17,7 +17,6 @@ services: environment: - PUID=1000 - PGID=1000 - - TZ=Europe/London volumes: - './data/syncthing:/var/syncthing/config' - './http-root/chaotic-aur:/repo' diff --git a/docker-compose.yml b/docker-compose.yml index 8d3bc40..4217734 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,6 @@ services: environment: - PUID=1000 - PGID=1000 - - TZ=Europe/London volumes: - './data/syncthing:/var/syncthing/config' - './http-root/chaotic-aur:/repo'