Created Dockerization option; created src folder; reated requirements.txt
This commit is contained in:
36
Docker/Dockerfile
Normal file
36
Docker/Dockerfile
Normal file
@@ -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"]
|
||||
17
Docker/build.sh
Executable file
17
Docker/build.sh
Executable file
@@ -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 $@;
|
||||
18
Docker/start.sh
Executable file
18
Docker/start.sh
Executable file
@@ -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 $@;
|
||||
|
||||
18
Docker/stop.sh
Executable file
18
Docker/stop.sh
Executable file
@@ -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 $@;
|
||||
9
requirements.txt
Normal file
9
requirements.txt
Normal file
@@ -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]
|
||||
Reference in New Issue
Block a user