Remove priv'ed components from default sample file.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-09-23 21:39:34 -05:00
parent 079d4dcabf
commit aa6d7bbd1e
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
4 changed files with 16 additions and 17 deletions

View File

@ -3,9 +3,9 @@
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
install-gitpod:
install-cloud-ide:
cp docker-compose.sample.yml docker-compose.yml
cp docker-compose.gitpod.yml docker-compose.override.yml
cp docker-compose.cloudide.yml docker-compose.override.yml
cp dev.env .env
cp azuracast.dev.env azuracast.env

View File

@ -83,10 +83,6 @@ services :
- frontend
- backend
restart : always
ulimits : &default-ulimits
nofile :
soft : 65536
hard : 65536
logging : &default-logging
options :
max-size : "1m"
@ -106,8 +102,6 @@ services :
redis :
container_name : azuracast_redis
image : "ghcr.io/azuracast/redis:${AZURACAST_VERSION:-latest}"
sysctls :
net.core.somaxconn : 1024
volumes :
- redis_data:/data
networks :
@ -283,7 +277,6 @@ services :
- backend
init : true
restart : always
ulimits : *default-ulimits
logging : *default-logging
networks :

View File

@ -333,14 +333,20 @@ class InstallCommand
// Remove privileged-mode settings if not enabled.
$enablePrivileged = $env->getAsBool('AZURACAST_COMPOSE_PRIVILEGED', true);
if (!$enablePrivileged) {
foreach ($yaml['services'] as &$service) {
unset(
$service['ulimits'],
$service['sysctls']
);
}
unset($service);
if ($enablePrivileged) {
$yaml['services']['redis']['sysctls'] = [
'net.core.somaxconn' => 1024,
];
$ulimits = [
'nofile' => [
'soft' => 65536,
'hard' => 65536,
],
];
$yaml['services']['web']['ulimits'] = $ulimits;
$yaml['services']['stations']['ulimits'] = $ulimits;
}
$yamlRaw = Yaml::dump($yaml, PHP_INT_MAX);