From 47ae17e3b9b47a57d419861a61210d41a9086bc9 Mon Sep 17 00:00:00 2001 From: Brian Morton Date: Sat, 15 Feb 2025 00:07:40 -0800 Subject: [PATCH 1/2] Simplify --- .devcontainer/Dockerfile | 3 -- .devcontainer/boot | 9 ---- .devcontainer/devcontainer.json | 70 +++++++++++++------------------- .devcontainer/docker-compose.yml | 8 ---- 4 files changed, 29 insertions(+), 61 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100755 .devcontainer/boot delete mode 100644 .devcontainer/docker-compose.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index e4c2042..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-24.04 - -RUN apt install curl ca-certificates git diff --git a/.devcontainer/boot b/.devcontainer/boot deleted file mode 100755 index 52d566b..0000000 --- a/.devcontainer/boot +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -echo "Updating RubyGems..." -gem update --system -N - -echo "Installing dependencies..." -bundle install - -echo "Done!" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 974f8b9..1b2b445 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,50 +1,38 @@ { - "name": "Ruby development", - "dockerComposeFile": "docker-compose.yml", - "service": "app", - "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + "name": "Ruby Gem Development", + "image": "ruby:3.4.2-bookworm", "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/common-utils:2": { - "username": "vscode", - "userUid": 1001, - "userGid": 1001, - "installZsh": true, - "installOhMyZsh": true, - "configureZshAsDefaultShell": true, - "upgradePackages": true - }, - "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "libpq-dev, libvips" - }, - "ghcr.io/devcontainers/features/ruby:1": { - "version": "3.4.1" - }, - "ghcr.io/devcontainers/features/node:1": {}, - "ghcr.io/devcontainers-extra/features/zsh-plugins:0": { - "username": "vscode", - "plugins": "bundler rails ruby yarn git" - }, - "ghcr.io/devcontainers/features/sshd:1": { - "version": "latest" - } + "ghcr.io/devcontainers/features/git:1": {} }, - - // Configure tool-specific properties. "customizations": { "vscode": { - "extensions": ["Shopify.ruby-lsp", "EditorConfig.EditorConfig"] + "extensions": [ + "Shopify.ruby-lsp", + "rebornix.Ruby", + "wingrunr21.vscode-ruby" + ], + "settings": { + "ruby.useBundler": true, + "ruby.interpreter.commandPath": "ruby", + "ruby.useLanguageServer": true, + "rubyLsp.formatter": "rubocop", + "rubyLsp.enabledFeatures": { + "semanticHighlighting": true, + "diagnostics": true, + "documentHighlights": true, + "documentSymbols": true, + "foldingRanges": true, + "selectionRanges": true, + "formatting": true, + "onTypeFormatting": true + }, + "ruby.lint": { + "rubocop": true + }, + "ruby.format": "rubocop" + } } }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // This can be used to network with other containers or the host. - "forwardPorts": [5433], - - "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": ".devcontainer/boot", - + "postCreateCommand": "gem install bundler && bundle install", "remoteUser": "vscode" } diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index ae967db..0000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - app: - build: - context: .. - dockerfile: .devcontainer/Dockerfile - volumes: - - ../..:/workspaces:cached - command: sleep infinity From e903b83ebbfe0ae0638777be518acc9edc03474f Mon Sep 17 00:00:00 2001 From: Brian Morton Date: Sat, 15 Feb 2025 00:19:04 -0800 Subject: [PATCH 2/2] Simplify again --- .devcontainer/devcontainer.json | 57 +++++++++++++-------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1b2b445..62c07d5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,38 +1,27 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node { - "name": "Ruby Gem Development", - "image": "ruby:3.4.2-bookworm", + "name": "ruby-lsp", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:0-20", "features": { - "ghcr.io/devcontainers/features/git:1": {} + "ghcr.io/devcontainers/features/rust:1": {}, + "ghcr.io/devcontainers/features/ruby:1": {} }, - "customizations": { - "vscode": { - "extensions": [ - "Shopify.ruby-lsp", - "rebornix.Ruby", - "wingrunr21.vscode-ruby" - ], - "settings": { - "ruby.useBundler": true, - "ruby.interpreter.commandPath": "ruby", - "ruby.useLanguageServer": true, - "rubyLsp.formatter": "rubocop", - "rubyLsp.enabledFeatures": { - "semanticHighlighting": true, - "diagnostics": true, - "documentHighlights": true, - "documentSymbols": true, - "foldingRanges": true, - "selectionRanges": true, - "formatting": true, - "onTypeFormatting": true - }, - "ruby.lint": { - "rubocop": true - }, - "ruby.format": "rubocop" - } - } - }, - "postCreateCommand": "gem install bundler && bundle install", - "remoteUser": "vscode" + "overrideFeatureInstallOrder": ["ghcr.io/devcontainers/features/rust"] + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" }