Skip to content

Commit

Permalink
Add docker-compose CPU limits
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-ion committed Feb 14, 2024
1 parent 6665f35 commit 2e3586d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-compose.insecureinc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ version: "3.7"
services:
insecureinc:
image: securecodingdojo/insecure.inc
deploy:
resources:
limits:
cpus: "0.9"
memory: 512M
reservations:
cpus: "0.9"
memory: 512M
build:
context: ./insecureinc
dockerfile: Dockerfile.insecureinc
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.trainingportal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ version: "3.7"
services:
trainingportal:
image: securecodingdojo/trainingportal
deploy:
resources:
limits:
cpus: "0.9"
memory: 512M
reservations:
cpus: "0.9"
memory: 512M
restart: "always" #change to always if you want the image to auto start
build:
context: ./trainingportal
Expand Down
40 changes: 40 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ version: "3.7"
services:
insecureinc:
image: securecodingdojo/insecure.inc
deploy:
resources:
limits:
cpus: "0.3"
memory: 256M
reservations:
cpus: "0.3"
memory: 256M
build:
context: ./insecureinc
dockerfile: Dockerfile.insecureinc
Expand All @@ -16,6 +24,14 @@ services:

trainingportal:
image: securecodingdojo/trainingportal
deploy:
resources:
limits:
cpus: "0.3"
memory: 256M
reservations:
cpus: "0.3"
memory: 256M
restart: "always" #change to always if you want the image to auto start
build:
context: ./trainingportal
Expand All @@ -34,6 +50,14 @@ services:

host1:
image: securecodingdojo/hackerden-host1
deploy:
resources:
limits:
cpus: "0.1"
memory: 128M
reservations:
cpus: "0.1"
memory: 128M
build:
context: ./hackerden
dockerfile: Dockerfile.host1
Expand All @@ -47,6 +71,14 @@ services:

host2:
image: securecodingdojo/hackerden-host2
deploy:
resources:
limits:
cpus: "0.1"
memory: 128M
reservations:
cpus: "0.1"
memory: 128M
build:
context: ./hackerden
dockerfile: Dockerfile.host2
Expand All @@ -60,6 +92,14 @@ services:

front:
image: securecodingdojo/hackerden-front
deploy:
resources:
limits:
cpus: "0.2"
memory: 128M
reservations:
cpus: "0.2"
memory: 128M
build:
context: ./hackerden
dockerfile: Dockerfile.front
Expand Down
24 changes: 24 additions & 0 deletions hackerden/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ version: "3.8"
services:
host1:
image: securecodingdojo/hackerden-host1
deploy:
resources:
limits:
cpus: "0.2"
memory: 128M
reservations:
cpus: "0.2"
memory: 128M
build:
context: .
dockerfile: Dockerfile.host1
Expand All @@ -19,6 +27,14 @@ services:

host2:
image: securecodingdojo/hackerden-host2
deploy:
resources:
limits:
cpus: "0.2"
memory: 128M
reservations:
cpus: "0.2"
memory: 128M
build:
context: .
dockerfile: Dockerfile.host2
Expand All @@ -34,6 +50,14 @@ services:

front:
image: securecodingdojo/hackerden-front
deploy:
resources:
limits:
cpus: "0.6"
memory: 256M
reservations:
cpus: "0.6"
memory: 256M
build:
context: .
dockerfile: Dockerfile.front
Expand Down

0 comments on commit 2e3586d

Please sign in to comment.