mirror of
https://litchi.icu/ngc2207/judge.git
synced 2025-05-18 22:37:11 +00:00
feat: add Docker configuration for PostgreSQL and Gitea services with clangd support
This commit is contained in:
parent
3cf2cd156a
commit
f7f1e01b72
1
docker/.gitignore
vendored
Normal file
1
docker/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.env
|
66
docker/compose.yml
Normal file
66
docker/compose.yml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
volumes:
|
||||||
|
postgres:
|
||||||
|
driver: local
|
||||||
|
gitea:
|
||||||
|
driver: local
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: docker.io/library/postgres:14
|
||||||
|
container_name: postgres
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
|
volumes:
|
||||||
|
- postgres:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 5s
|
||||||
|
|
||||||
|
gitea:
|
||||||
|
image: docker.io/gitea/gitea:1.22.6
|
||||||
|
container_name: gitea
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- GITEA__database__DB_TYPE=postgres
|
||||||
|
- GITEA__database__HOST=postgres:5432
|
||||||
|
- GITEA__database__NAME=${POSTGRES_DB}
|
||||||
|
- GITEA__database__USER=${POSTGRES_USER}
|
||||||
|
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- gitea:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "22:22"
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
lsp-c:
|
||||||
|
image: clangd:latest
|
||||||
|
build:
|
||||||
|
context: ./lsp/clangd
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: lsp-c
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "30001:3000"
|
||||||
|
|
||||||
|
lsp-cpp:
|
||||||
|
image: clangd:latest
|
||||||
|
build:
|
||||||
|
context: ./lsp/clangd
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: lsp-cpp
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "30002: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