fix manager-solution

This commit is contained in:
2026-01-19 12:06:05 +01:00
parent 6a19f7cde6
commit 94b3a5ae88
261 changed files with 14723 additions and 17 deletions

View File

@@ -9,6 +9,6 @@ RUN pip install -r requirements.txt
COPY manager.py .
COPY config.json .
ENV INACTIVITY_SECONDS=30
ENV INACTIVITY_SECONDS=10
CMD ["python", "manager.py"]

View File

@@ -1,5 +1,21 @@
{
"users": [
{
"id": "abc",
"port": 3004,
"container_name": "abc",
"volumes": {
"v-conf-user1": "/config"
},
"environment": {
"PUID": "1000",
"PGID": "1000",
"PASSWORD": "Fiscality2025!"
},
"mem_limit": "3g",
"memswap_limit": "5g",
"privileged": true
},
{
"id": "user1",
"port": 3001,

View File

@@ -9,7 +9,7 @@ import time
import docker
CONFIG_PATH = "config.json"
INACTIVITY_SECONDS = int(os.getenv("INACTIVITY_SECONDS", "1800"))
INACTIVITY_SECONDS = int(os.getenv("INACTIVITY_SECONDS", "3"))
APP_PORT = 3000
client = docker.from_env()
@@ -157,7 +157,7 @@ async def handle_connection(reader, writer, user):
async def idle_checker():
"""Stop idle containers"""
while True:
await asyncio.sleep(30)
await asyncio.sleep(10)
now = time.time()
for uid, last_active in list(user_activity.items()):