From 8e71a3c74e4c5834e36563bb2b362669b9e78d4b Mon Sep 17 00:00:00 2001 From: ajikamaludin Date: Thu, 16 Mar 2023 08:07:37 +0700 Subject: [PATCH] add limit to service --- docker-compose.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b20460d..84bf3e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,9 @@ services: - ./user.ini:/usr/local/etc/php/php.ini - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" + mem_limit: 512m + mem_reservation: 128M + cpus: 0.5 networks: - template nginx: @@ -25,6 +28,9 @@ services: volumes: - ./:/var/www - ./default.conf:/etc/nginx/conf.d/default.conf + mem_limit: 512m + mem_reservation: 128M + cpus: 0.5 networks: - template mariadb: @@ -40,6 +46,9 @@ services: MARIADB_USER: app MARIADB_PASSWORD: password MARIADB_ROOT_PASSWORD: password + mem_limit: 512m + mem_reservation: 128M + cpus: 0.5 networks: template: ipv4_address: 10.8.0.99 @@ -57,6 +66,9 @@ services: POSTGRES_DB: app POSTGRES_USER: app POSTGRES_PASSWORD: password + mem_limit: 512m + mem_reservation: 128M + cpus: 0.5 networks: template: ipv4_address: 10.8.0.96 @@ -69,6 +81,9 @@ services: - ./:/var/www working_dir: /var/www entrypoint: ["npm","run", "dev"] + mem_limit: 512m + mem_reservation: 128M + cpus: 0.5 networks: - template