From 7896adb1bbcb5ca379b1727950ec15a4ae791df8 Mon Sep 17 00:00:00 2001 From: tomoya yoshida Date: Wed, 30 Apr 2025 20:30:51 +0900 Subject: [PATCH] =?UTF-8?q?devcontainer=E3=81=AE=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2c33aa1cc..a62f44186 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,14 +3,17 @@ // Config options: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/ruby { "name": "coderdojo.jp", + "dockerComposeFile": "../docker-compose.yml", + "service": "rails", + "workspaceFolder": "/app", + "overrideCommand": true, - // Universal is well-customized image for Codespaces: - // https://hub.docker.com/_/microsoft-devcontainers-universal - "image": "mcr.microsoft.com/devcontainers/universal:latest", - - // Use Ruby image if you want to pin Ruby version like '3.2' - // https://github.com/devcontainers/images/tree/main/src/ruby - //"image": "mcr.microsoft.com/devcontainers/ruby:3.0", + "containerEnv": { + "DATABASE_USER": "postgres", + "DATABASE_PASSWORD": "password", + "DATABASE_HOST": "db", + "DATABASE_PORT": "5432" + }, // Enable learners to choose an affordable spec, starting at minimum one. //"hostRequirements": { @@ -21,12 +24,10 @@ "waitFor": "onCreateCommand", "onCreateCommand": "gem install solargraph -N", - //"onCreateCommand": "", //# => Solargraph gem not found. Run `gem install solargraph` or update your Gemfile. "updateContentCommand": "bundle install", - "postCreateCommand": "", "postAttachCommand": { - "server": "rails server" + "server": "rm -f /app/tmp/pids/server.pid && rails server -b 0.0.0.0" }, "customizations": { "codespaces": { @@ -47,7 +48,7 @@ //"ruby.lint": { "rubocop": true }, //"ruby.intellisense": "rubyLocate", "editor.tabSize": 2, - "editor.renderWhitespace": false, + "editor.renderWhitespace": "none", "files.associations": { "*.erb": "erb" }, "emmet.includeLanguages": { "erb": "html" },