Browse Source

docker-compose: added CPU & memory limit

Fabian Peter Hammerle 3 years ago
parent
commit
24a827ac5f
2 changed files with 5 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 4 1
      docker-compose.yml

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   - `org.opencontainers.image.source` (repo url)
   - `org.opencontainers.image.title`
 - set env var `MPLCONFIGDIR=/config/matplotlib`
+- `docker-compose`: added CPU & memory limit
 
 ### Fixed
 - `docker-compose`: drop capabilities

+ 4 - 1
docker-compose.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: '2.2'
 
 volumes:
   config:
@@ -12,6 +12,9 @@ services:
     ports: ['127.0.0.1:8123:8123']
     cap_drop: [ALL]
     security_opt: [no-new-privileges]
+    # docker-compose >=2.2,<3
+    cpus: 2
+    mem_limit: 512M
     restart: on-failure
 
 # https://docs.docker.com/compose/compose-file/compose-file-v2/