From 8d1651a561c10b37d683672b814f5adcf49f2e18 Mon Sep 17 00:00:00 2001 From: rudolf Date: Mon, 2 Jun 2025 23:56:25 +0200 Subject: [PATCH] improvements --- PROD.md | 20 ++++++++++++++++ docker-compose-nginx.yaml | 5 ++++ docker-compose-registry.yaml | 4 ++-- poc/immich/stack-compose.yml | 32 +++++++++++-------------- poc/lampa/README.md | 7 ++++++ poc/lampa/docker-compose.yaml | 44 +++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 21 deletions(-) create mode 100644 PROD.md create mode 100644 poc/lampa/README.md create mode 100644 poc/lampa/docker-compose.yaml diff --git a/PROD.md b/PROD.md new file mode 100644 index 0000000..3894f85 --- /dev/null +++ b/PROD.md @@ -0,0 +1,20 @@ +# Prod setup + +## Swarm init +docker swarm init --advertise-addr 192.168.1.96 --force-new-cluster +Swarm initialized: current node (j9bljgaqh9qch2nmozvu2bprs) is now a manager. +To add a worker to this swarm, run the following command: +docker swarm join --token SWMTKN-1-0eb9ypg3ouig0ac493scmjtogida7ddy79xr2e9kkvaitoz0y0-7t5lg5sx8q20uqz2uandsblc9 192.168.1.96:2377 + +## Prod instances + + +docker stack deploy --compose-file poc/immich/stack-compose.yml immich +docker stack deploy --compose-file docker-compose-registry.yaml registry +docker stack deploy --compose-file poc/lampa/docker-compose.yaml lampa + +docker stack deploy --compose-file docker-compose-nginx.yaml nginx + +### Draft + +docker network create --driver overlay nginx_ingress \ No newline at end of file diff --git a/docker-compose-nginx.yaml b/docker-compose-nginx.yaml index d142e78..b116a8e 100644 --- a/docker-compose-nginx.yaml +++ b/docker-compose-nginx.yaml @@ -40,6 +40,7 @@ services: replicas: 1 networks: default: + nginx_ingress: nginx_acme: image: nginxproxy/acme-companion @@ -63,3 +64,7 @@ services: replicas: 1 networks: default: + +networks: + nginx_ingress: + external: true \ No newline at end of file diff --git a/docker-compose-registry.yaml b/docker-compose-registry.yaml index 99c0f99..5a04b2f 100644 --- a/docker-compose-registry.yaml +++ b/docker-compose-registry.yaml @@ -13,10 +13,10 @@ services: volumes: - data:/var/lib/registry networks: - - nginx_default + - nginx_ingress networks: - nginx_default: + nginx_ingress: external: true volumes: diff --git a/poc/immich/stack-compose.yml b/poc/immich/stack-compose.yml index acded7f..4f50408 100644 --- a/poc/immich/stack-compose.yml +++ b/poc/immich/stack-compose.yml @@ -26,13 +26,12 @@ services: - node.hostname==odroid # - node.hostname==rudolf-T mode: replicated -# networks: -# default: -# ansible_proxy-tier-swarm: -# healthcheck: -# disable: false - -# dd if=/media/from_hd/ubuntu-20.04.3-desktop-amd64.iso of=/dev/null bs=8k count=10k + networks: + default: + nginx_ingress: + healthcheck: + start_interval: 2m + disable: false machine-learning: # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. @@ -54,10 +53,9 @@ services: # - node.hostname==rudolf-T mode: replicated replicas: 2 -# healthcheck: -# disable: false -# http://machine-learning:3003 -# http://192.168.1.70:3003 + healthcheck: + start_interval: 2m + disable: false redis: @@ -97,11 +95,10 @@ services: mode: replicated replicas: 1 -#docker run \ -#--publish 5432:5432 \ -#--network ansible_proxy-tier \ -#alpine/socat \ -#tcp-listen:5432,fork,reuseaddr tcp-connect:immich_database.1.gkb5gp4mz1gp0d30yy9wfys7g:5432 + +networks: + nginx_ingress: + external: true volumes: model-cache: @@ -119,6 +116,3 @@ volumes: type: nfs o: addr=192.168.1.96 device: :/media/DATA/runtime/immich/library - -# default: -# internal: true \ No newline at end of file diff --git a/poc/lampa/README.md b/poc/lampa/README.md new file mode 100644 index 0000000..6df2dd2 --- /dev/null +++ b/poc/lampa/README.md @@ -0,0 +1,7 @@ +http://95.142.46.84:5665 + +git clone https://github.com/yumata/lampa.git + +docker build --build-arg domain=lampa.rudolf.keenetic.link -t registry.rudolf.keenetic.link/lampa:arm64 . + +#docker run -p 8080:80 -d --restart unless-stopped -it --name lampa registry.rudolf.keenetic.link/lampa:arm64 \ No newline at end of file diff --git a/poc/lampa/docker-compose.yaml b/poc/lampa/docker-compose.yaml new file mode 100644 index 0000000..71c6626 --- /dev/null +++ b/poc/lampa/docker-compose.yaml @@ -0,0 +1,44 @@ +services: + lampa: + image: registry.rudolf.keenetic.link/lampa:arm64 + ports: + - 8084:80 + restart: always + environment: + - VIRTUAL_HOST=lampa.rudolf.keenetic.link + - LETSENCRYPT_HOST=lampa.rudolf.keenetic.link +# - Access-Control-Allow-Origin "*" + networks: + nginx_ingress: + + jackett: + image: ghcr.io/hotio/jackett + ports: + - 9117:9117 + environment: + - TZ="Etc/UTC" + - VIRTUAL_HOST=jk.lampa.rudolf.keenetic.link + - LETSENCRYPT_HOST=jk.lampa.rudolf.keenetic.link + volumes: + - jackett_config:/config + networks: + nginx_ingress: + + torrserv: + image: alpine/socat + command: "TCP-LISTEN:9090,fork,reuseaddr TCP:95.142.46.84:5665" + ports: + - 9090:9090 + environment: + - VIRTUAL_HOST=torrserv.lampa.rudolf.keenetic.link + - LETSENCRYPT_HOST=torrserv.lampa.rudolf.keenetic.link + restart: unless-stopped + networks: + nginx_ingress: + +volumes: + jackett_config: + +networks: + nginx_ingress: + external: true