Docker move to alpine; moved sub README to servers
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
# 1. A: Use an existing Python image
|
# 1. A: Define a base image
|
||||||
FROM python:3.12
|
# FROM python:3.12
|
||||||
|
# FROM alpine:3.22.1
|
||||||
|
FROM alpine:latest
|
||||||
|
# FROM debian:bookworm-slim
|
||||||
|
|
||||||
# 1. B: Set ENV Variables
|
# 1. B: Set ENV Variables
|
||||||
|
ENV PYTHON_VERSION=3.12
|
||||||
|
ENV JAVA_VERSION=22.0.2
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
ENV PYENV_ROOT="/opt/pyenv"
|
||||||
|
|
||||||
|
ENV PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
|
||||||
|
|
||||||
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
|
# 2. Set the working directory inside the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -17,20 +23,72 @@ COPY requirements.txt .
|
|||||||
COPY package.json .
|
COPY package.json .
|
||||||
COPY src/* .
|
COPY src/* .
|
||||||
|
|
||||||
# 4. A: Install the dependencies
|
# 4. A: Install dependencies
|
||||||
RUN apt update
|
# RUN apt update
|
||||||
RUN apt install -y curl libgirepository1.0-dev
|
# RUN apt install -y pkg-config curl clang gopls git libgirepository1.0-dev libssl-dev libcairo2-dev
|
||||||
|
|
||||||
|
RUN apk update
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
bash \
|
||||||
|
bash-completion \
|
||||||
|
curl \
|
||||||
|
clang \
|
||||||
|
pkgconf \
|
||||||
|
make \
|
||||||
|
git \
|
||||||
|
gopls \
|
||||||
|
linux-headers \
|
||||||
|
build-base \
|
||||||
|
openssh \
|
||||||
|
tzdata \
|
||||||
|
openssl-dev \
|
||||||
|
bzip2-dev \
|
||||||
|
zlib-dev \
|
||||||
|
xz-dev \
|
||||||
|
sqlite-dev \
|
||||||
|
readline-dev \
|
||||||
|
libffi-dev \
|
||||||
|
gdbm-dev \
|
||||||
|
gobject-introspection-dev \
|
||||||
|
cairo-dev
|
||||||
|
|
||||||
|
RUN curl -fsSL https://pyenv.run | bash
|
||||||
|
RUN pyenv install ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION} && pyenv local ${PYTHON_VERSION}
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# 4. B: Install nvm and node
|
# 4. B: Install nvm and node
|
||||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
# 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 install ${NODE_VERSION}
|
||||||
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
|
# RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
|
||||||
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
|
# RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
|
||||||
|
|
||||||
RUN node --version
|
RUN node --version
|
||||||
RUN npm --version
|
RUN npm --version
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# 5. Expose Port and define the command used to run the app
|
# 5. A: Remove dependencies
|
||||||
|
RUN apk del \
|
||||||
|
linux-headers \
|
||||||
|
build-base \
|
||||||
|
openssh \
|
||||||
|
tzdata \
|
||||||
|
openssl-dev \
|
||||||
|
bzip2-dev \
|
||||||
|
zlib-dev \
|
||||||
|
xz-dev \
|
||||||
|
sqlite-dev \
|
||||||
|
readline-dev \
|
||||||
|
libffi-dev \
|
||||||
|
gdbm-dev \
|
||||||
|
gobject-introspection-dev \
|
||||||
|
cairo-dev
|
||||||
|
|
||||||
|
RUN rm -rf /tmp/*
|
||||||
|
RUN rm -rf /opt/nvm/.cache
|
||||||
|
RUN rm /app/requirements.txt
|
||||||
|
|
||||||
|
# 6. Expose Port and define the command used to run the app
|
||||||
EXPOSE 9999
|
EXPOSE 9999
|
||||||
CMD ["npm", "run", "start-verbose"]
|
CMD ["npm", "run", "start-verbose"]
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
**Dockerfiles for Language Server Protocol (LSP) servers** - Containerized language servers for use with IDEs.
|
**Dockerfiles for Language Server Protocol (LSP) servers** - Containerized language servers for use with IDEs.
|
||||||
|
|
||||||
|
## Note:
|
||||||
|
Files under here were copied from https://github.com/lspcontainers/dockerfiles/servers. This README is modified from the repo as well.
|
||||||
|
|
||||||
## What is this?
|
## What is this?
|
||||||
|
|
||||||
This sub repository provides **production-ready Docker containers** for 25+ Language Server Protocol (LSP) servers.
|
This sub repository provides **production-ready Docker containers** for 25+ Language Server Protocol (LSP) servers.
|
||||||
|
|
||||||
## Note:
|
|
||||||
Files under servers/ were copied from https://github.com/lspcontainers/dockerfiles/servers. The root dockerfile is primary and not part of the reference servers. This README is modified from the other repo.
|
|
||||||
|
|
||||||
### **How it works:**
|
### **How it works:**
|
||||||
1. **Docker containers** provide isolated, reproducible LSP server environments
|
1. **Docker containers** provide isolated, reproducible LSP server environments
|
||||||
3. **Zero local installation** - no need to install language servers on your system
|
3. **Zero local installation** - no need to install language servers on your system
|
||||||
@@ -12,6 +12,12 @@ function main() {
|
|||||||
cd "${SCRIPTPATH}"
|
cd "${SCRIPTPATH}"
|
||||||
echo "Working Dir: " $(pwd)
|
echo "Working Dir: " $(pwd)
|
||||||
|
|
||||||
|
ID=$(podman ps --filter "ancestor=localhost/newton-lsp:latest" --format "{{.ID}}")
|
||||||
|
if [ "${ID}" != "" ]; then
|
||||||
|
echo "Is up..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
podman run -p 9999:9999 newton-lsp:latest
|
podman run -p 9999:9999 newton-lsp:latest
|
||||||
}
|
}
|
||||||
main $@;
|
main $@;
|
||||||
|
|||||||
@@ -11,7 +11,12 @@ function main() {
|
|||||||
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
cd "${SCRIPTPATH}"
|
cd "${SCRIPTPATH}"
|
||||||
echo "Working Dir: " $(pwd)
|
echo "Working Dir: " $(pwd)
|
||||||
|
|
||||||
ID=$(podman ps --filter "ancestor=localhost/newton-lsp:latest" --format "{{.ID}}")
|
ID=$(podman ps --filter "ancestor=localhost/newton-lsp:latest" --format "{{.ID}}")
|
||||||
|
if [ "${ID}" == "" ]; then
|
||||||
|
echo "Is not up..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
podman container stop "${ID}"
|
podman container stop "${ID}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user