LoginSignup
0
0

【Solargraph】Solargraphをコンテナで動かす【Docker】

Posted at

Dockerfileを作成

以下がDockerfileの例です。

Dockerfile
FROM ruby:3.1.2

WORKDIR /app
RUN gem install solargraph

EXPOSE 7658

docker-compose.ymlを作成

docker-compose.ymlを以下のように作成します。

docker-compose.yml
solargraph:
    build: .
    command: bundle exec solargraph socket --host=0.0.0.0 --port=7658
    volumes:
      - .:/app
    ports:
      - "7658:7658"

docker-compose.ymlを作成したらコンテナを起動します。

ターミナル
$ docker-compose up -d solargraph

拡張機能をインストール

VSCodeに以下の拡張機能をインストールします。

拡張機能の設定

setting.jsonに以下のように記述し、拡張機能の設定をします。

setting.json
"solargraph.externalServer": {
  "host": "localhost",
  "port": 7658
},
"solargraph.transport": "external"

これでVSCodeでsolargraphが使用可能になります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0