-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi ruby devcontainer setup (#2568)
* Add .devcontainer setup * Update code workspace configuration * Use REDIS_HOST in specs * Update CONTRIBUTING.md
- Loading branch information
Showing
9 changed files
with
154 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
IMAGE=bitnami/ruby | ||
|
||
# Adjust as needed | ||
TAG=3.4 | ||
|
||
# IMAGE=jruby | ||
# TAG=latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
ARG IMAGE="bitnami/ruby" | ||
ARG TAG="latest" | ||
|
||
FROM ${IMAGE}:${TAG} | ||
|
||
USER root | ||
RUN apt-get update && apt-get install -y \ | ||
gnupg \ | ||
git \ | ||
curl \ | ||
wget \ | ||
zsh \ | ||
vim \ | ||
build-essential \ | ||
sudo \ | ||
libssl-dev \ | ||
libreadline-dev \ | ||
zlib1g-dev \ | ||
autoconf \ | ||
bison \ | ||
libyaml-dev \ | ||
libncurses5-dev \ | ||
libffi-dev \ | ||
libgdbm-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN groupadd --gid 1000 sentry \ | ||
&& useradd --uid 1000 --gid sentry --shell /bin/zsh --create-home sentry | ||
|
||
# Add sentry to sudoers with NOPASSWD option | ||
RUN echo "sentry ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/sentry \ | ||
&& chmod 0440 /etc/sudoers.d/sentry | ||
|
||
WORKDIR /workspace/sentry | ||
|
||
RUN chown -R sentry:sentry /workspace/sentry | ||
RUN mkdir /workspace/gems && chown -R sentry:sentry /workspace/gems | ||
|
||
ARG TAG=latest | ||
|
||
ENV LANG=C.UTF-8 \ | ||
BUNDLE_JOBS=4 \ | ||
BUNDLE_RETRY=3 \ | ||
GEM_HOME=/workspace/gems/${TAG} \ | ||
REDIS_HOST=redis | ||
|
||
USER sentry | ||
|
||
CMD ["ruby", "--version"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "sentry-ruby", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspace/sentry", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"sleistner.vscode-fileutils", | ||
"Shopify.ruby-lsp" | ||
] | ||
} | ||
}, | ||
"remoteUser": "sentry", | ||
"postCreateCommand": "ruby --version" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
IMAGE: ${IMAGE} | ||
TAG: ${TAG} | ||
volumes: | ||
- ..:/workspace/sentry:cached | ||
command: sleep infinity | ||
environment: | ||
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0} | ||
depends_on: | ||
- redis | ||
|
||
redis: | ||
image: redis:latest | ||
environment: | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
ports: | ||
- "6379:6379" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "sentry-ruby" | ||
}, | ||
{ | ||
"path": "sentry-rails" | ||
}, | ||
{ | ||
"path": "sentry-sidekiq" | ||
}, | ||
{ | ||
"path": "sentry-delayed_job" | ||
}, | ||
{ | ||
"path": "sentry-resque" | ||
}, | ||
{ | ||
"path": "sentry-opentelemetry" | ||
}, | ||
{ | ||
"path": ".github" | ||
} | ||
], | ||
"extensions": { | ||
"recommendations": [ | ||
"Shopify.ruby-lsp" | ||
] | ||
"folders": [ | ||
{ | ||
"path": ".devcontainer" | ||
}, | ||
{ | ||
"path": ".github", | ||
}, | ||
{ | ||
"path": ".", | ||
"name": "root" | ||
}, | ||
{ | ||
"path": "sentry-ruby" | ||
}, | ||
{ | ||
"path": "sentry-rails" | ||
}, | ||
{ | ||
"path": "sentry-sidekiq" | ||
}, | ||
{ | ||
"path": "sentry-delayed_job" | ||
}, | ||
{ | ||
"path": "sentry-resque" | ||
}, | ||
{ | ||
"path": "sentry-opentelemetry" | ||
}, | ||
{ | ||
"path": "sentry-raven" | ||
} | ||
], | ||
"extensions": { | ||
"recommendations": [ | ||
"Shopify.ruby-lsp" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters