Attempts to add memory limit

This commit is contained in:
Viktor Petersson
2021-01-06 10:24:11 +00:00
parent 63eb2fc42d
commit d0454f8740
3 changed files with 7 additions and 0 deletions

View File

@@ -197,6 +197,7 @@
apt:
name:
- rpi-update
- bc
state: latest
- name: Remove deprecated apt dependencies

View File

@@ -141,6 +141,8 @@ if [ -z "${REPOSITORY}" ]; then
fi
fi
sudo mkdir -p /etc/ansible
echo -e "[local]\nlocalhost ansible_connection=local" | sudo tee /etc/ansible/hosts > /dev/null
@@ -173,7 +175,10 @@ fi
sudo pip install ansible==2.8.8
# Export various environment variables
export MY_IP=$(ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n')
TOTAL_MEMORY_KB=$(grep MemTotal /proc/meminfo | awk {'print $2'})
export VIEWER_MEMORY_LIMIT_KB=$(echo "$TOTAL_MEMORY_KB" * 0.7 | bc)
sudo -u pi ansible localhost \
-m git \

View File

@@ -12,6 +12,7 @@ services:
srly-ose-viewer:
image: screenly/srly-ose-viewer:${DOCKER_TAG}-${DEVICE_TYPE}
mem_limit: ${VIEWER_MEMORY_LIMIT_KB}k
volumes:
- /home/pi/.screenly:/data/.screenly
- /home/pi/screenly_assets:/data/screenly_assets