Skip to content

Commit 8173810

Browse files
committed
adding files for dev-containers with ruby-lsp
1 parent 6e75e3e commit 8173810

5 files changed

Lines changed: 36 additions & 3 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
{
22
"name": "Existing Docker Compose (Extend)",
33
"dockerComposeFile": [
4-
"../compose.yml",
4+
"../compose.yml"
55
],
66
"service": "app",
77
"workspaceFolder": "/app",
88
"features": {
99
"ghcr.io/devcontainers/features/git:1": {},
1010
"ghcr.io/devcontainers/features/sshd:1": {}
11+
},
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-azuretools.vscode-docker",
16+
"shopify.ruby-extensions-pack",
17+
"testdouble.vscode-standard-ruby"
18+
]
19+
}
1120
}
1221
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
.vscode-server
99
.ssh
1010
.gitconfig
11+
.local
12+
.dotnet
1113

1214
.env
1315
vendor/

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,29 @@ ARG GID=1000
1010
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
1111
build-essential
1212

13-
RUN gem install bundler
1413

1514
RUN groupadd -g ${GID} -o app
1615
RUN useradd -m -d /app -u ${UID} -g ${GID} -o -s /bin/bash app
1716

17+
ENV GEM_HOME=/gems
18+
ENV PATH="$PATH:/gems/bin"
19+
RUN mkdir -p /gems && chown ${UID}:${GID} /gems
20+
1821

1922
ENV BUNDLE_PATH /app/vendor/bundle
2023

24+
# Change to app and back so that bundler created files in /gmes are owned by the
25+
# app user
26+
USER app
27+
RUN gem install bundler
28+
USER root
29+
2130
WORKDIR /app
2231

2332
CMD ["tail", "-f", "/dev/null"]
2433

2534
################################################################################
26-
# DEVELOPMENT #
35+
# DEVELOPMENT #
2736
################################################################################
2837
FROM base AS development
2938

@@ -39,6 +48,7 @@ FROM base AS production
3948

4049

4150
ENV BUNDLE_WITHOUT=development:test
51+
4252
COPY --chown=${UID}:${GID} . /app
4353

4454
USER app

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ end
1313

1414
group :development do
1515
gem "standard"
16+
gem "ruby-lsp"
1617
end

Gemfile.lock

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ GEM
99
json (2.9.0)
1010
language_server-protocol (3.17.0.3)
1111
lint_roller (1.1.0)
12+
logger (1.6.3)
1213
method_source (1.1.0)
1314
parallel (1.26.3)
1415
parser (3.3.6.0)
1516
ast (~> 2.4.1)
1617
racc
18+
prism (1.2.0)
1719
pry (0.14.2)
1820
coderay (~> 1.1)
1921
method_source (~> 1.0)
@@ -22,6 +24,8 @@ GEM
2224
pry (>= 0.13, < 0.15)
2325
racc (1.8.1)
2426
rainbow (3.1.1)
27+
rbs (3.7.0)
28+
logger
2529
regexp_parser (2.9.3)
2630
rspec (3.13.0)
2731
rspec-core (~> 3.13.0)
@@ -51,6 +55,11 @@ GEM
5155
rubocop-performance (1.23.0)
5256
rubocop (>= 1.48.1, < 2.0)
5357
rubocop-ast (>= 1.31.1, < 2.0)
58+
ruby-lsp (0.22.1)
59+
language_server-protocol (~> 3.17.0)
60+
prism (>= 1.2, < 2.0)
61+
rbs (>= 3, < 4)
62+
sorbet-runtime (>= 0.5.10782)
5463
ruby-progressbar (1.13.0)
5564
simplecov (0.22.0)
5665
docile (~> 1.1)
@@ -59,6 +68,7 @@ GEM
5968
simplecov-html (0.13.1)
6069
simplecov-lcov (0.8.0)
6170
simplecov_json_formatter (0.1.4)
71+
sorbet-runtime (0.5.11691)
6272
standard (1.43.0)
6373
language_server-protocol (~> 3.17.0.2)
6474
lint_roller (~> 1.0)
@@ -83,6 +93,7 @@ DEPENDENCIES
8393
pry
8494
pry-byebug
8595
rspec
96+
ruby-lsp
8697
simplecov
8798
simplecov-lcov
8899
standard

0 commit comments

Comments
 (0)