diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..3788dc6 --- /dev/null +++ b/Docker/Dockerfile @@ -0,0 +1,36 @@ +# 1. A: Use an existing Python image +FROM python:3.12 + +# 1. B: Set ENV Variables +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +ENV NODE_VERSION=24.9.0 +ENV NVM_DIR=/root/.nvm +ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" + +# 2. Set the working directory inside the container +WORKDIR /app + +# 3. Copy the requirements and src files +COPY requirements.txt . +COPY package.json . +COPY src/* . + +# 4. A: Install the dependencies +RUN apt update +RUN apt install -y curl libgirepository1.0-dev +RUN pip install --no-cache-dir -r requirements.txt + +# 4. B: Install nvm and node +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} +RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} +RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} +RUN node --version +RUN npm --version +RUN npm install + +# 5. Expose Port and define the command used to run the app +EXPOSE 9999 +CMD ["npm", "run", "start-verbose"] \ No newline at end of file diff --git a/Docker/build.sh b/Docker/build.sh new file mode 100755 index 0000000..87f2462 --- /dev/null +++ b/Docker/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# . CONFIG.sh + +# set -o xtrace ## To debug scripts +# set -o errexit ## To exit on error +# set -o errunset ## To exit if a variable is referenced but not set + + +function main() { + SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )" + cd "${SCRIPTPATH}/.." + echo "Working Dir: " $(pwd) + + podman build -t newton-lsp -f Docker/Dockerfile . +} +main $@; diff --git a/Docker/start.sh b/Docker/start.sh new file mode 100755 index 0000000..ea147be --- /dev/null +++ b/Docker/start.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# . CONFIG.sh + +# set -o xtrace ## To debug scripts +# set -o errexit ## To exit on error +# set -o errunset ## To exit if a variable is referenced but not set + + +function main() { + SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )" + cd "${SCRIPTPATH}" + echo "Working Dir: " $(pwd) + + podman run -p 9999:9999 newton-lsp:latest +} +main $@; + diff --git a/Docker/stop.sh b/Docker/stop.sh new file mode 100755 index 0000000..38b81b4 --- /dev/null +++ b/Docker/stop.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# . CONFIG.sh + +# set -o xtrace ## To debug scripts +# set -o errexit ## To exit on error +# set -o errunset ## To exit if a variable is referenced but not set + + +function main() { + SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )" + cd "${SCRIPTPATH}" + echo "Working Dir: " $(pwd) + ID=$(podman ps --filter "ancestor=localhost/newton-lsp:latest" --format "{{.ID}}") + + podman container stop "${ID}" +} +main $@; diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9a23d88 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +PyGObject==3.40.1 +pygobject-stubs --config-settings=config=Gtk3,Gdk3,Soup2 +setproctitle==1.2.2 +pyxdg==0.27 +psutil==5.8.0 +pycryptodome==3.20.0 +sqlmodel==0.0.19 +python-lsp-server[all] +python-lsp-server[websockets] diff --git a/index.js.REMOVED.git-id b/src/index.js.REMOVED.git-id similarity index 100% rename from index.js.REMOVED.git-id rename to src/index.js.REMOVED.git-id diff --git a/languageServers.js b/src/languageServers.js similarity index 100% rename from languageServers.js rename to src/languageServers.js diff --git a/paths-utility.js b/src/paths-utility.js similarity index 100% rename from paths-utility.js rename to src/paths-utility.js