Skip to content

Commit cc3c9d4

Browse files
committed
Fix devcontainer up workflow
1 parent d13773c commit cc3c9d4

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

.devcontainer/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Containers extension) or GitHub Codespaces and use that environment for all work
77

88
The devcontainer starts one service named `app` and exposes:
99

10-
- **Port 3000:** Ruby app
10+
- **Port 3001:** Ruby app (forwarded from container port 3000)
1111
- **Port 4321:** Astro dev server
1212

1313
The repo is mounted at `/workspace`. Bundler gems are cached in a Docker volume to speed up
@@ -23,6 +23,9 @@ make setup
2323

2424
This installs Ruby and frontend dependencies inside the container.
2525

26+
If setup fails due to missing network access (e.g., GitHub DNS), rerun `make setup` once
27+
network access is available.
28+
2629
## Common commands (run inside the container)
2730

2831
```

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
}
2828
}
2929
},
30-
"forwardPorts": [3000, 4321],
30+
"forwardPorts": [3001, 4321],
3131
"portsAttributes": {
32-
"3000": {
32+
"3001": {
3333
"label": "Ruby App",
3434
"onAutoForward": "notify"
3535
},
@@ -38,6 +38,6 @@
3838
"onAutoForward": "silent"
3939
}
4040
},
41-
"postCreateCommand": "make setup",
41+
"postCreateCommand": "bash -lc \"make setup || (echo 'make setup failed; rerun once network access is available.' && exit 0)\"",
4242
"remoteUser": "vscode"
4343
}

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
- ../:/workspace:cached
1010
- bundle-cache:/usr/local/bundle
1111
ports:
12-
- "3000:3000"
12+
- "3001:3000"
1313
environment:
1414
- RACK_ENV=development
1515
- BUNDLE_PATH=/usr/local/bundle

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ bundle exec rubocop -F
6464
bundle exec rspec
6565
```
6666

67+
Dev Container app URL: `http://localhost:3001`.
68+
6769
## Frontend Development
6870
```
6971
cd frontend

0 commit comments

Comments
 (0)