diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-02 15:39:30 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-02 15:39:30 +0900 |
| commit | 913de6b1934881c0a8ee978cf6a0cfd664e1df9a (patch) | |
| tree | 8ccb5684f2d0c5156b7a8c1746834458196310a5 /docker-compose.yml | |
| parent | 6174901a121cebf6448db3fef5e68a375dec9b61 (diff) | |
feat: add resource limits and network isolation to docker-compose
Diffstat (limited to 'docker-compose.yml')
| -rw-r--r-- | docker-compose.yml | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index bf0fa6e..d11db2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,12 @@ services: interval: 5s timeout: 3s retries: 5 + networks: [internal] + deploy: + resources: + limits: + memory: 256M + cpus: '0.5' postgres: image: postgres:16-alpine @@ -26,6 +32,12 @@ services: interval: 5s timeout: 3s retries: 5 + networks: [internal] + deploy: + resources: + limits: + memory: 256M + cpus: '0.5' data-collector: build: @@ -45,6 +57,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' strategy-engine: build: @@ -64,6 +82,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 1G + cpus: '1.0' order-executor: build: @@ -83,6 +107,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' portfolio-manager: build: @@ -102,6 +132,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' api: build: @@ -121,6 +157,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' news-collector: build: @@ -140,6 +182,12 @@ services: timeout: 5s retries: 3 restart: unless-stopped + networks: [internal] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' loki: image: grafana/loki:latest @@ -150,6 +198,12 @@ services: - ./monitoring/loki/loki-config.yaml:/etc/loki/local-config.yaml - loki_data:/loki command: -config.file=/etc/loki/local-config.yaml + networks: [monitoring] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' promtail: image: grafana/promtail:latest @@ -160,6 +214,12 @@ services: command: -config.file=/etc/promtail/config.yaml depends_on: - loki + networks: [monitoring] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' prometheus: image: prom/prometheus:latest @@ -173,6 +233,12 @@ services: - strategy-engine - order-executor - portfolio-manager + networks: [internal, monitoring] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' grafana: image: grafana/grafana:latest @@ -187,8 +253,20 @@ services: - ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards depends_on: - prometheus + networks: [internal, monitoring] + deploy: + resources: + limits: + memory: 512M + cpus: '1.0' volumes: redis_data: postgres_data: loki_data: + +networks: + internal: + driver: bridge + monitoring: + driver: bridge |
