Skip to content

Commit

Permalink
introduce resource limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
khanzadimahdi committed Jan 11, 2025
1 parent 92011ed commit 327fdbe
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compose.docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.50'
memory: 500M
runtime: sysbox-runc
# privileged: true # To test localy: enable this line and disable runtime
environment:
Expand Down
4 changes: 4 additions & 0 deletions compose.docker_dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.20'
memory: 150M
command: >
--admin-password="${PORTAINER_ADMIN_PASSWORD}"
Expand Down
4 changes: 4 additions & 0 deletions compose.mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.50'
memory: 500M
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
Expand Down
4 changes: 4 additions & 0 deletions compose.mongodb_dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.20'
memory: 150M
environment:
ME_CONFIG_BASICAUTH_USERNAME: ${DASHBOARD_MONGO_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${DASHBOARD_MONGO_PASSWORD}
Expand Down
4 changes: 4 additions & 0 deletions compose.nats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.20'
memory: 200M
volumes:
- ${VOLUME_PATH}/nats:/data
command: ["--jetstream", "--http_port", "8222", "--port", "4222", "--store_dir", "/data"]
Expand Down
4 changes: 4 additions & 0 deletions compose.proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ services:
condition: on-failure
delay: 5s
max_attempts: 3
resources:
limits:
cpus: '0.20'
memory: 200M
ports:
- 80:80

Expand Down

0 comments on commit 327fdbe

Please sign in to comment.