feat: add memory limits to Docker services in various configurations

This commit is contained in:
2025-08-23 04:39:17 +02:00
parent 9c85d2eea6
commit b5227230c0
21 changed files with 142 additions and 0 deletions

View File

@@ -17,6 +17,10 @@ services:
restart: "unless-stopped" restart: "unless-stopped"
networks: networks:
- arr_stack_net - arr_stack_net
deploy:
resources:
limits:
memory: 1G
sonarr: sonarr:
image: linuxserver/sonarr:latest image: linuxserver/sonarr:latest
@@ -35,6 +39,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- arr_stack_net - arr_stack_net
deploy:
resources:
limits:
memory: 1G
whisparr: whisparr:
image: ghcr.io/hotio/whisparr:latest image: ghcr.io/hotio/whisparr:latest
@@ -52,6 +60,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- arr_stack_net - arr_stack_net
deploy:
resources:
limits:
memory: 1G
prowlarr: prowlarr:
container_name: prowlarr container_name: prowlarr
@@ -69,6 +81,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- arr_stack_net - arr_stack_net
deploy:
resources:
limits:
memory: 512M
flaresolverr: flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest image: ghcr.io/flaresolverr/flaresolverr:latest
@@ -85,6 +101,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- arr_stack_net - arr_stack_net
deploy:
resources:
limits:
memory: 1G
overseerr: overseerr:
image: sctx/overseerr:latest image: sctx/overseerr:latest
@@ -102,6 +122,10 @@ services:
networks: networks:
- arr_stack_net - arr_stack_net
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 512M
networks: networks:
arr_stack_net: arr_stack_net:

View File

@@ -9,3 +9,7 @@ services:
- 27003:27003/udp - 27003:27003/udp
- 27020:27020/udp - 27020:27020/udp
- 27021:27021/udp - 27021:27021/udp
deploy:
resources:
limits:
memory: 4G

View File

@@ -10,6 +10,10 @@ services:
networks: networks:
- beszel-net - beszel-net
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 256M
beszel-agent: beszel-agent:
image: henrygd/beszel-agent:latest image: henrygd/beszel-agent:latest
@@ -21,6 +25,10 @@ services:
environment: environment:
LISTEN: /beszel_socket/beszel.sock LISTEN: /beszel_socket/beszel.sock
KEY: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkSIQDh1vS8lG+2Uw/9dK1eOgCHVCgQfP+Bfk4XPkdn' KEY: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkSIQDh1vS8lG+2Uw/9dK1eOgCHVCgQfP+Bfk4XPkdn'
deploy:
resources:
limits:
memory: 128M
networks: networks:
beszel-net: beszel-net:

View File

@@ -21,6 +21,10 @@ services:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
networks: networks:
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 512M
networks: networks:
caddy_network: caddy_network:

View File

@@ -24,6 +24,10 @@ services:
- OPENVPN_PASSWORD={{ lookup('community.general.onepassword', 'Gluetun', vault='Dotfiles', field='OPENVPN_PASSWORD') }} - OPENVPN_PASSWORD={{ lookup('community.general.onepassword', 'Gluetun', vault='Dotfiles', field='OPENVPN_PASSWORD') }}
- SERVER_COUNTRIES={{ lookup('community.general.onepassword', 'Gluetun', vault='Dotfiles', field='SERVER_COUNTRIES') }} - SERVER_COUNTRIES={{ lookup('community.general.onepassword', 'Gluetun', vault='Dotfiles', field='SERVER_COUNTRIES') }}
restart: always restart: always
deploy:
resources:
limits:
memory: 512M
sabnzbd: sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest image: lscr.io/linuxserver/sabnzbd:latest
@@ -39,6 +43,10 @@ services:
depends_on: depends_on:
gluetun: gluetun:
condition: service_healthy condition: service_healthy
deploy:
resources:
limits:
memory: 1G
qbittorrent: qbittorrent:
image: lscr.io/linuxserver/qbittorrent image: lscr.io/linuxserver/qbittorrent
@@ -55,6 +63,10 @@ services:
gluetun: gluetun:
condition: service_healthy condition: service_healthy
restart: always restart: always
deploy:
resources:
limits:
memory: 1G
networks: networks:
arr_stack_net: arr_stack_net:

View File

@@ -11,6 +11,10 @@ services:
networks: networks:
- dozzle-net - dozzle-net
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 256M
networks: networks:
dozzle-net: dozzle-net:

View File

@@ -16,6 +16,10 @@ services:
-a /opt/echoip/GeoLite2-ASN.mmdb -a /opt/echoip/GeoLite2-ASN.mmdb
-c /opt/echoip/GeoLite2-City.mmdb -c /opt/echoip/GeoLite2-City.mmdb
-f /opt/echoip/GeoLite2-Country.mmdb -f /opt/echoip/GeoLite2-Country.mmdb
deploy:
resources:
limits:
memory: 128M
networks: networks:
caddy_network: caddy_network:

View File

@@ -19,6 +19,10 @@ services:
networks: networks:
- factorio - factorio
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 2G
networks: networks:
factorio: factorio:

View File

@@ -15,6 +15,10 @@ services:
networks: networks:
- gitea - gitea
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 1G
postgres: postgres:
image: postgres:15-alpine image: postgres:15-alpine
@@ -29,6 +33,10 @@ services:
- {{gitea_data_dir}}/postgres:/var/lib/postgresql/data - {{gitea_data_dir}}/postgres:/var/lib/postgresql/data
networks: networks:
- gitea - gitea
deploy:
resources:
limits:
memory: 1G
act_runner: act_runner:
image: gitea/act_runner:latest image: gitea/act_runner:latest
@@ -46,6 +54,10 @@ services:
restart: always restart: always
networks: networks:
- gitea - gitea
deploy:
resources:
limits:
memory: 2G
networks: networks:
gitea: gitea:

View File

@@ -8,3 +8,7 @@ services:
volumes: volumes:
- {{ golink_data_dir }}:/home/nonroot - {{ golink_data_dir }}:/home/nonroot
restart: "unless-stopped" restart: "unless-stopped"
deploy:
resources:
limits:
memory: 256M

View File

@@ -15,3 +15,7 @@ services:
network_mode: host network_mode: host
devices: devices:
- /dev/ttyUSB0:/dev/ttyUSB0 - /dev/ttyUSB0:/dev/ttyUSB0
deploy:
resources:
limits:
memory: 2G

View File

@@ -26,6 +26,8 @@ services:
runtime: nvidia runtime: nvidia
deploy: deploy:
resources: resources:
limits:
memory: 4G
reservations: reservations:
devices: devices:
- driver: nvidia - driver: nvidia
@@ -49,6 +51,8 @@ services:
runtime: nvidia runtime: nvidia
deploy: deploy:
resources: resources:
limits:
memory: 8G
reservations: reservations:
devices: devices:
- driver: nvidia - driver: nvidia
@@ -63,6 +67,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- immich - immich
deploy:
resources:
limits:
memory: 1G
database: database:
container_name: immich_postgres container_name: immich_postgres
@@ -100,6 +108,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- immich - immich
deploy:
resources:
limits:
memory: 2G
volumes: volumes:
model-cache: model-cache:

View File

@@ -25,6 +25,10 @@ services:
- MYSQL_PASSWORD={{ lookup('community.general.onepassword', 'Nextcloud', vault='Dotfiles', field='MYSQL_NEXTCLOUD_PASSWORD') }} - MYSQL_PASSWORD={{ lookup('community.general.onepassword', 'Nextcloud', vault='Dotfiles', field='MYSQL_NEXTCLOUD_PASSWORD') }}
- MYSQL_HOST=nextclouddb - MYSQL_HOST=nextclouddb
- REDIS_HOST=redis - REDIS_HOST=redis
deploy:
resources:
limits:
memory: 2G
nextclouddb: nextclouddb:
image: mariadb:11.4.7 image: mariadb:11.4.7
@@ -43,6 +47,10 @@ services:
- MYSQL_PASSWORD={{ lookup('community.general.onepassword', 'Nextcloud', vault='Dotfiles', field='MYSQL_NEXTCLOUD_PASSWORD') }} - MYSQL_PASSWORD={{ lookup('community.general.onepassword', 'Nextcloud', vault='Dotfiles', field='MYSQL_NEXTCLOUD_PASSWORD') }}
- MYSQL_DATABASE=nextcloud - MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud - MYSQL_USER=nextcloud
deploy:
resources:
limits:
memory: 1G
redis: redis:
image: redis:alpine image: redis:alpine
@@ -51,6 +59,10 @@ services:
- {{ nextcloud_data_dir }}/redis:/data - {{ nextcloud_data_dir }}/redis:/data
networks: networks:
- nextcloud - nextcloud
deploy:
resources:
limits:
memory: 512M
networks: networks:
nextcloud: nextcloud:

View File

@@ -19,6 +19,8 @@ services:
- {{ '/mnt/data/music' }}:/music - {{ '/mnt/data/music' }}:/music
deploy: deploy:
resources: resources:
limits:
memory: 4G
reservations: reservations:
devices: devices:
- driver: nvidia - driver: nvidia

View File

@@ -22,6 +22,10 @@ services:
start_period: 90s start_period: 90s
networks: networks:
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 256M
networks: networks:
caddy_network: caddy_network:

View File

@@ -11,3 +11,7 @@ services:
- 6335 - 6335
volumes: volumes:
- {{ qdrant_data_dir }}:/qdrant/storage - {{ qdrant_data_dir }}:/qdrant/storage
deploy:
resources:
limits:
memory: 2G

View File

@@ -17,6 +17,10 @@ services:
start_period: 5s start_period: 5s
networks: networks:
- juicefs-network - juicefs-network
deploy:
resources:
limits:
memory: 256M
networks: networks:
juicefs-network: juicefs-network:

View File

@@ -30,6 +30,10 @@ services:
- {{ stash_config_dir }}/generated:/generated - {{ stash_config_dir }}/generated:/generated
networks: networks:
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 2G
networks: networks:
caddy_network: caddy_network:

View File

@@ -14,6 +14,10 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- caddy_network - caddy_network
deploy:
resources:
limits:
memory: 512M
networks: networks:
caddy_network: caddy_network:

View File

@@ -29,6 +29,10 @@ services:
- caddy_network - caddy_network
sysctls: sysctls:
- net.ipv6.conf.all.disable_ipv6=1 - net.ipv6.conf.all.disable_ipv6=1
deploy:
resources:
limits:
memory: 1G
unifi-db: unifi-db:
image: mongo:6.0 image: mongo:6.0
@@ -48,6 +52,10 @@ services:
- unifi-network - unifi-network
sysctls: sysctls:
- net.ipv6.conf.all.disable_ipv6=1 - net.ipv6.conf.all.disable_ipv6=1
deploy:
resources:
limits:
memory: 1G
networks: networks:
unifi-network: unifi-network:

View File

@@ -17,3 +17,7 @@ services:
sysctls: sysctls:
- net.ipv4.conf.all.src_valid_mark=1 - net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped restart: unless-stopped
deploy:
resources:
limits:
memory: 512M