mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
feat(docker): Add Docker configuration for clangd-based C/C++ LSP servers
This commit is contained in:
parent
baeafb92dd
commit
e2bb58a034
20
docker/compose.yml
Normal file
20
docker/compose.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
services:
|
||||||
|
lsp-c:
|
||||||
|
image: clangd:latest
|
||||||
|
build:
|
||||||
|
context: ./lsp/clangd
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: lsp-c
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "4594:3000"
|
||||||
|
|
||||||
|
lsp-cpp:
|
||||||
|
image: clangd:latest
|
||||||
|
build:
|
||||||
|
context: ./lsp/clangd
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: lsp-cpp
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "4595:3000"
|
25
docker/lsp/clangd/Dockerfile
Normal file
25
docker/lsp/clangd/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
FROM alpine:latest as builder
|
||||||
|
|
||||||
|
RUN apk add --no-cache git npm
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN git clone https://github.com/wylieconlon/jsonrpc-ws-proxy.git
|
||||||
|
|
||||||
|
WORKDIR /app/jsonrpc-ws-proxy
|
||||||
|
|
||||||
|
COPY servers.yml .
|
||||||
|
|
||||||
|
RUN npm install && npm run prepare
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache build-base clang-extra-tools nodejs
|
||||||
|
|
||||||
|
WORKDIR /app/jsonrpc-ws-proxy
|
||||||
|
|
||||||
|
COPY --from=builder /app/jsonrpc-ws-proxy .
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["node", "dist/server.js", "--port", "3000", "--languageServers", "servers.yml"]
|
5
docker/lsp/clangd/servers.yml
Normal file
5
docker/lsp/clangd/servers.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
langservers:
|
||||||
|
clangd:
|
||||||
|
- /usr/bin/clangd
|
||||||
|
- --log=verbose
|
||||||
|
- --background-index
|
Loading…
Reference in New Issue
Block a user