diff --git a/compose.yml b/compose.yml index 3cb61ab..2a6af9f 100644 --- a/compose.yml +++ b/compose.yml @@ -1,15 +1,22 @@ services: - monaco-editor-lsp-next: - image: cfngc4594/monaco-editor-lsp-next:latest - container_name: monaco-editor-lsp-next + judge4c: + build: + context: . + dockerfile: Dockerfile + image: judge4c:latest + container_name: judge4c restart: always ports: - "3000:3000" networks: - - monaco-editor-lsp-next + - judge4c depends_on: - - lsp-c - - lsp-cpp + postgres: + condition: service_healthy + lsp-c: + condition: service_healthy + lsp-cpp: + condition: service_healthy healthcheck: test: [ "CMD-SHELL", "curl --fail http://localhost:3000 || exit 1" ] interval: 10s @@ -20,13 +27,16 @@ services: - /var/run/docker.sock:/var/run/docker.sock lsp-c: - image: cfngc4594/lsp-c:latest + build: + context: ./docker/lsp/clangd + dockerfile: Dockerfile + image: lsp-c:latest container_name: lsp-c restart: always ports: - "4594:3000" networks: - - monaco-editor-lsp-next + - judge4c healthcheck: test: [ "CMD-SHELL", "nc -zv localhost 3000" ] interval: 10s @@ -34,20 +44,40 @@ services: retries: 5 lsp-cpp: - image: cfngc4594/lsp-cpp:latest + build: + context: ./docker/lsp/clangd + dockerfile: Dockerfile + image: lsp-cpp:latest container_name: lsp-cpp restart: always ports: - "4595:3000" networks: - - monaco-editor-lsp-next + - judge4c healthcheck: test: [ "CMD-SHELL", "nc -zv localhost 3000" ] interval: 10s timeout: 5s 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: - monaco-editor-lsp-next: - name: monaco-editor-lsp-next - driver: bridge + judge4c: + name: judge4c