Skip to content

Commit 1171416

Browse files
authored
Fix devcontainer setup and upgrade Ruby to 3.4.7 (#325)
* Fix devcontainer setup: Migrate to Docker Compose and upgrade Ruby to 3.4.7 * space fixes
1 parent e5a1f6b commit 1171416

File tree

6 files changed

+38
-23
lines changed

6 files changed

+38
-23
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
2+
ARG RUBY_VERSION=3.4.7
3+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
4+
5+
# Ensure binding is always 0.0.0.0
6+
# Binds the server to all IP addresses of the container, so it can be accessed from outside the container.
7+
ENV BINDING="0.0.0.0"

.devcontainer/compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "ruby_ui"
2+
3+
services:
4+
app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile
8+
9+
volumes:
10+
- ../../ruby_ui:/workspaces/ruby_ui:cached
11+
# Overrides default command so things don't shut down after the process ends.
12+
command: sleep infinity

.devcontainer/devcontainer.json

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
1+
// For format details, see https://containers.dev/implementors/json_reference/.
2+
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
33
{
4-
"name": "RubyUI",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "ghcr.io/rails/devcontainer/images/ruby:3.3.3",
4+
"name": "ruby_ui",
5+
"dockerComposeFile": "compose.yaml",
6+
"service": "app",
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
78
// Features to add to the dev container. More info: https://containers.dev/features.
8-
// Make sure RUBY_VERSION matches the Ruby version in .ruby-version
99
"features": {
10-
"ghcr.io/devcontainers/features/github-cli:1": {}
10+
"ghcr.io/devcontainers/features/github-cli:1": {},
11+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
12+
"moby": false
13+
}
1114
},
1215
"customizations": {
1316
"vscode": {
1417
"extensions": [
1518
"testdouble.vscode-standard-ruby",
1619
"Shopify.ruby-lsp"
17-
],
18-
"settings": {
19-
"rubyLsp.rubyVersionManager": {
20-
"identifier": "rbenv"
21-
}
22-
}
20+
]
2321
}
2422
},
25-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26-
// "forwardPorts": [],
27-
// Use 'postCreateCommand' to run commands after the container is created.
28-
"onCreateCommand": "bundle install"
2923
// Configure tool-specific properties.
3024
// "customizations": {},
31-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32-
// "remoteUser": "root"
33-
}
25+
// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
26+
// "remoteUser": "root",
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
"postCreateCommand": "bundle check || bundle install"
29+
}

.standard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ruby_version: 3.3
1+
ruby_version: 3.4
22
format: progress
33
parallel: true

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ruby 3.3.5
1+
ruby 3.4.7
22

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2024 RubyUI
3+
Copyright (c) 2025 RubyUI
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)