forked from retoor/snek
feat: replace runtime ubuntu image with custom snek_ubuntu and move r binary into Dockerfile
Add DockerfileUbuntu that pre-installs r binary and all required system dependencies, removing the need for per-container apt installs and binary copy from .bashrc. Update terminal view to use the new snek_ubuntu image instead of ubuntu:latest. Fix terminal session buffer check to use self.history instead of self.buffer. Add docker build target to Makefile.
This commit is contained in:
@@ -32,7 +32,7 @@ class TerminalSession:
|
||||
|
||||
async def read_output(self, ws):
|
||||
self.sockets.append(ws)
|
||||
if len(self.sockets) > 1 and self.buffer:
|
||||
if len(self.sockets) > 1 and self.history:
|
||||
start = 0
|
||||
try:
|
||||
start = self.history.index(b'\n')
|
||||
|
||||
@@ -30,7 +30,10 @@ class TerminalSocketView(BaseView):
|
||||
user = await self.services.user.get(uid=self.session.get("uid"))
|
||||
root = await self.prepare_drive()
|
||||
|
||||
command = f"docker run -v ./{root}/:/root --rm -it --memory 512M --cpus=0.5 -w /root ubuntu:latest /bin/bash"
|
||||
|
||||
|
||||
|
||||
command = f"docker run -v ./{root}/:/root -it --memory 512M --cpus=0.5 -w /root snek_ubuntu /bin/bash"
|
||||
|
||||
session = self.user_sessions.get(user["uid"])
|
||||
if not session:
|
||||
|
||||
Reference in New Issue
Block a user