feat(compose): add judge4c and postgres services, update lsp-c and lsp-cpp configurations, and change network to judge4c

This commit is contained in:
cfngc4594 2025-03-15 21:31:31 +08:00
parent ef6de27957
commit 34266de048

View File

@ -1,15 +1,22 @@
services: services:
monaco-editor-lsp-next: judge4c:
image: cfngc4594/monaco-editor-lsp-next:latest build:
container_name: monaco-editor-lsp-next context: .
dockerfile: Dockerfile
image: judge4c:latest
container_name: judge4c
restart: always restart: always
ports: ports:
- "3000:3000" - "3000:3000"
networks: networks:
- monaco-editor-lsp-next - judge4c
depends_on: depends_on:
- lsp-c postgres:
- lsp-cpp condition: service_healthy
lsp-c:
condition: service_healthy
lsp-cpp:
condition: service_healthy
healthcheck: healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:3000 || exit 1" ] test: [ "CMD-SHELL", "curl --fail http://localhost:3000 || exit 1" ]
interval: 10s interval: 10s
@ -20,13 +27,16 @@ services:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
lsp-c: lsp-c:
image: cfngc4594/lsp-c:latest build:
context: ./docker/lsp/clangd
dockerfile: Dockerfile
image: lsp-c:latest
container_name: lsp-c container_name: lsp-c
restart: always restart: always
ports: ports:
- "4594:3000" - "4594:3000"
networks: networks:
- monaco-editor-lsp-next - judge4c
healthcheck: healthcheck:
test: [ "CMD-SHELL", "nc -zv localhost 3000" ] test: [ "CMD-SHELL", "nc -zv localhost 3000" ]
interval: 10s interval: 10s
@ -34,20 +44,40 @@ services:
retries: 5 retries: 5
lsp-cpp: lsp-cpp:
image: cfngc4594/lsp-cpp:latest build:
context: ./docker/lsp/clangd
dockerfile: Dockerfile
image: lsp-cpp:latest
container_name: lsp-cpp container_name: lsp-cpp
restart: always restart: always
ports: ports:
- "4595:3000" - "4595:3000"
networks: networks:
- monaco-editor-lsp-next - judge4c
healthcheck: healthcheck:
test: [ "CMD-SHELL", "nc -zv localhost 3000" ] test: [ "CMD-SHELL", "nc -zv localhost 3000" ]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
postgres:
image: postgres:16-alpine
container_name: postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5432:5432"
networks:
- judge4c
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 2s
retries: 20
networks: networks:
monaco-editor-lsp-next: judge4c:
name: monaco-editor-lsp-next name: judge4c
driver: bridge