瀏覽代碼

Changed compose

Nicole Portas 1 月之前
父節點
當前提交
53aeae858a
共有 1 個文件被更改,包括 24 次插入1 次删除
  1. 24 1
      docker-compose.yml

+ 24 - 1
docker-compose.yml

@@ -1,12 +1,23 @@
 services:
   redis:
     image: redis:7.2.4
+    deploy:
+      resources:
+        limits:
+          cpus: '0.5'
+          memory: 128M
     ports:
       - "127.0.0.1:6379:6379"
+
   web:
     build:
       context: .
       dockerfile: ./web/Dockerfile
+    deploy:
+      resources:
+        limits:
+          cpus: '0.5'
+          memory: 512M
     environment:
       CBS_REDIS_HOST: redis
       CBS_REDIS_PORT: 6379
@@ -23,12 +34,19 @@ services:
       - redis
     ports:
       - "0.0.0.0:${WEB_PORT:-8080}:8080"
+
   builder:
     build:
       context: .
       dockerfile: ./builder/Dockerfile
     restart: always
     stop_grace_period: 5m
+    # --- THE CPU MUZZLE ---
+    deploy:
+      resources:
+        limits:
+          cpus: '2.0'
+          memory: 2G  # Ardupilot builds need a decent chunk of RAM
     environment:
       CBS_REDIS_HOST: redis
       CBS_REDIS_PORT: 6379
@@ -46,8 +64,13 @@ services:
     build: ./overlay_manager
     restart: always
     pid: "service:builder"
+    deploy:
+      resources:
+        limits:
+          cpus: '0.5'
+          memory: 256M
     environment:
-      CBS_BUILD_TIMEOUT_SEC: ${CBS_BUILD_TIMEOUT_SEC:-900} # Matches your builder timeout
+      CBS_BUILD_TIMEOUT_SEC: ${CBS_BUILD_TIMEOUT_SEC:-900}
     volumes:
       - ./custom_overlays:/srv:rw
       - ./overlay_db:/app/db