LuaLS / LuaLS/lua-language-server

Need help with running lua lsp in a docker container

Open
#2,718 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

Hi, this is what I am trying to do:
- I have a web editor made with react and monaco editor
- The editor is for writing lua code
- I want lua lsp autocompletions in the web editor
- I am trying to run the lua-language-server in a docker container which I hope to later run on a VPS and make the editor frontend connect to this remote lsp server to provide autocompletions

Setup:
- I used the homebrew docker image to install lua-language-server https://hub.docker.com/r/homebrew/brew

Issue faced:

When I run just the `lua-language-server` command, it seems to be running, but when I specify a socket, it does not start and gives a connection refused error.

![image](https://github.com/LuaLS/lua-language-server/assets/50258860/a2f98a5d-3850-42c6-9ecf-d912325d3a66)

![image](https://github.com/LuaLS/lua-language-server/assets/50258860/a3b02e37-923c-45d2-8364-6a5f9c7d2eb9)

moreover when I install the lsp on my mac machine and run the same command, it doesnot throw and error and seems to run silently

![image](https://github.com/LuaLS/lua-language-server/assets/50258860/2256f064-8230-4e0c-b428-67ec61e9cf1b)

If anyone needs any additional details please let me know

Dockerfile:

```
# Use the official Homebrew Docker image as the base
FROM homebrew/brew:latest

# Install lua-language-server
RUN brew install lua-language-server

# Verify installation
RUN lua-language-server --version

# Set working directory
WORKDIR /workspace

# ENTRYPOINT ["lua-language-server --socket=5000"]

# CMD ["lua-language-server", "--socket=5000"]

EXPOSE 5000

CMD ["bash"]
```

tried both ENTRYPOINT and CMD, same results, which is why I used bash and interactive mode to debug

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dockerfile and the two invocation forms shown for lua-language-server, then reproduce the connection-refused behavior with --socket=5000 inside the Homebrew image. Compare that result with the silent macOS run and determine the documented container invocation and connection behavior needed for the remote editor setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, lua
Domain
devops, devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.