commit fd1131c35c563b6012e8b199b6c02514339547db Author: Michael B Date: Sat Mar 29 15:55:23 2025 +0000 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a946fc8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.AppImage +data/* +* copy* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a504559 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,60 @@ + +ARG baseimage=nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04 + +FROM ${baseimage} AS baseimage +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 + + +ENV TZ="Etc/UTC" + +ARG DEBIAN_FRONTEND=noninteractive +# Build arguments +ARG ARG_UID=1000 +ARG ARG_GID=1000 + +RUN < ~/.bashrc + +/squashfs-root/lm-studio --no-sandbox & +sleep 30 +~/.cache/lm-studio/bin/lms server start --cors & + + +sleep 5 +# ~/.cache/lm-studio/bin/lms get ${MODEL_PATH} +~/.cache/lm-studio/bin/lms load --gpu 0.3 --ttl 3600 --context-length ${CONTEXT_LENGTH:-16384} ${MODEL_IDENTIFIER} & + +sleep 20 +cp -f /http-server-config.json /root/.cache/lm-studio/.internal/http-server-config.json +x11vnc -display :99 -forever -rfbauth /root/.vnc/passwd -quiet -listen 0.0.0.0 -xkb + +/bin/bash diff --git a/docker-healthcheck.sh b/docker-healthcheck.sh new file mode 100644 index 0000000..d24b83f --- /dev/null +++ b/docker-healthcheck.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Send a request to the specified URL +response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:1234/v1) + +# If the HTTP response code is 200 (OK), the server is up +if [ "$response" -eq 200 ]; then + echo "Server is up" + exit 0 +else + echo "Server is down" + exit 1 +fi diff --git a/http-server-config.json b/http-server-config.json new file mode 100644 index 0000000..42a7a7d --- /dev/null +++ b/http-server-config.json @@ -0,0 +1,8 @@ +{ + "port": 1234, + "cors": true, + "logSensitiveData": true, + "verbose": false, + "logLinesLimit": 500, + "networkInterface": "0.0.0.0" +} \ No newline at end of file