Skip to content

Commit 524edd3

Browse files
committed
Align dev ports to 4000-range
1 parent cc3c9d4 commit 524edd3

11 files changed

Lines changed: 41 additions & 47 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ ENV BUNDLE_PATH=/usr/local/bundle
2929

3030
USER "$USER"
3131

32-
EXPOSE 3000
32+
EXPOSE 4000
3333

3434
CMD ["sleep", "infinity"]

.devcontainer/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ 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 3001:** Ruby app (forwarded from container port 3000)
11-
- **Port 4321:** Astro dev server
10+
- **Port 4000:** Ruby app
11+
- **Port 4001:** Astro dev server
1212

1313
The repo is mounted at `/workspace`. Bundler gems are cached in a Docker volume to speed up
1414
future launches.

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
}
2828
}
2929
},
30-
"forwardPorts": [3001, 4321],
30+
"forwardPorts": [4000, 4001],
3131
"portsAttributes": {
32-
"3001": {
32+
"4000": {
3333
"label": "Ruby App",
3434
"onAutoForward": "notify"
3535
},
36-
"4321": {
36+
"4001": {
3737
"label": "Astro Dev Server",
3838
"onAutoForward": "silent"
3939
}

.devcontainer/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ services:
99
- ../:/workspace:cached
1010
- bundle-cache:/usr/local/bundle
1111
ports:
12-
- "3001:3000"
12+
- "4000:4000"
1313
environment:
1414
- RACK_ENV=development
1515
- BUNDLE_PATH=/usr/local/bundle
16+
- PORT=4000
1617
command: sleep infinity
1718
user: vscode
1819
working_dir: /workspace

README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ curl -X POST "https://your-domain.com/api/v1/feeds" \
4545
2. Set `HTML2RSS_SECRET_KEY` in `docker-compose.yml`.
4646
3. Start: `docker-compose up`.
4747

48-
UI + API run on `http://localhost:3000`. The app exits if the secret key is missing.
48+
UI + API run on `http://localhost:4000`. The app exits if the secret key is missing.
4949

50-
## Development (Dev Container only)
51-
We support a single, batteries-included workflow based on the repository's
52-
[Dev Container](.devcontainer/README.md). Always work inside the Dev Container locally or in
53-
GitHub Codespaces—running the app directly on the host is no longer documented or supported.
54-
All agents and automation must run inside the Dev Container as well.
50+
## Development (Dev Container)
51+
Use the repository's [Dev Container](.devcontainer/README.md) for all local development and tests.
52+
Running the app directly on the host is not supported.
5553

56-
Inside the Dev Container, use:
54+
Quick start inside the Dev Container:
5755

5856
```
5957
make setup
@@ -64,37 +62,29 @@ bundle exec rubocop -F
6462
bundle exec rspec
6563
```
6664

67-
Dev Container app URL: `http://localhost:3001`.
68-
69-
## Frontend Development
70-
```
71-
cd frontend
72-
npm install
73-
npm run dev
74-
```
75-
The Ruby server continues to serve the production build while Astro runs with hot reload on port 4321.
65+
Dev URLs: Ruby app at `http://localhost:4000`, Astro dev server at `http://localhost:4001`.
7666

7767
## Make Targets
7868

7969
| Command | Purpose |
8070
| -------------------- | ------------------------------------------------------- |
8171
| `make help` | List available shortcuts. |
8272
| `make setup` | Install Ruby and Node dependencies. |
83-
| `make dev` | Run Ruby (port 3000) and Astro (port 4321) dev servers. |
73+
| `make dev` | Run Ruby (port 4000) and Astro (port 4001) dev servers. |
8474
| `make dev-ruby` | Start only the Ruby server. |
85-
| `make dev-frontend` | Start only the Astro dev server. |
75+
| `make dev-frontend` | Start only the Astro dev server (port 4001). |
8676
| `make test` | Run Ruby and frontend test suites. |
8777
| `make test-ruby` | Run Ruby specs. |
8878
| `make test-frontend` | Run frontend unit and contract tests. |
8979
| `make lint` | Run all linters. |
9080
| `make lintfix` | Auto-fix lint warnings where possible. |
9181
| `make clean` | Remove build artefacts. |
9282

93-
## Frontend npm Scripts
83+
## Frontend npm Scripts (inside Dev Container)
9484

9585
| Command | Purpose |
9686
| ----------------------- | --------------------------------- |
97-
| `npm run dev` | Astro dev server with hot reload. |
87+
| `npm run dev` | Astro dev server with hot reload (port 4001). |
9888
| `npm run build` | Production build. |
9989
| `npm run test:run` | Unit tests (Vitest). |
10090
| `npm run test:contract` | Contract tests with MSW. |

bin/dev

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cleanup() {
3131

3232
# Clean up any remaining processes on our ports
3333
pkill -f "puma.*html2rss-web" 2>/dev/null || true
34-
pkill -f "astro.*dev.*3001" 2>/dev/null || true
34+
pkill -f "astro.*dev.*4001" 2>/dev/null || true
3535

3636
echo "✅ Development servers stopped"
3737
exit 0
@@ -40,18 +40,18 @@ cleanup() {
4040
trap cleanup SIGINT SIGTERM
4141

4242
# Prevent silent failures from port conflicts
43-
if lsof -Pi :3000 -sTCP:LISTEN -t >/dev/null 2>&1; then
44-
echo "❌ Port 3000 is already in use. Run: \`pkill -f 'puma.*html2rss-web'\`"
43+
if lsof -Pi :4000 -sTCP:LISTEN -t >/dev/null 2>&1; then
44+
echo "❌ Port 4000 is already in use. Run: \`pkill -f 'puma.*html2rss-web'\`"
4545
exit 1
4646
fi
4747

4848
# Start Ruby server
49-
bundle exec puma -p 3000 -C config/puma.rb &
49+
bundle exec puma -p 4000 -C config/puma.rb &
5050
RUBY_PID=$!
5151

5252
# Verify Ruby server started successfully
5353
sleep 3
54-
if ! kill -0 $RUBY_PID 2>/dev/null || ! lsof -Pi :3000 -sTCP:LISTEN -t >/dev/null 2>&1; then
54+
if ! kill -0 $RUBY_PID 2>/dev/null || ! lsof -Pi :4000 -sTCP:LISTEN -t >/dev/null 2>&1; then
5555
echo "❌ Ruby server failed to start"
5656
exit 1
5757
fi
@@ -69,5 +69,5 @@ if ! kill -0 $ASTRO_PID 2>/dev/null; then
6969
exit 1
7070
fi
7171

72-
echo "✅ Development environment ready at http://localhost:3001"
72+
echo "✅ Development environment ready at http://localhost:4001"
7373
wait $RUBY_PID $ASTRO_PID

bin/dev-ruby

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ fi
1111
export RACK_ENV=${RACK_ENV:-development}
1212

1313
# Prevent silent failures from port conflicts
14-
if lsof -Pi :${PORT:-3000} -sTCP:LISTEN -t >/dev/null 2>&1; then
15-
echo "❌ Port ${PORT:-3000} is already in use. Run: pkill -f 'puma.*html2rss-web'"
14+
if lsof -Pi :${PORT:-4000} -sTCP:LISTEN -t >/dev/null 2>&1; then
15+
echo "❌ Port ${PORT:-4000} is already in use. Run: pkill -f 'puma.*html2rss-web'"
1616
exit 1
1717
fi
1818

1919
echo "Starting Ruby server (code reloading enabled)"
20-
bundle exec puma -p ${PORT:-3000} -C config/puma.rb
20+
bundle exec puma -p ${PORT:-4000} -C config/puma.rb

bin/dev-with-frontend

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export RACK_ENV=${RACK_ENV:-development}
1414

1515
echo "Starting html2rss-web development environment..."
1616
echo "Environment: $RACK_ENV"
17-
echo "Ruby server: http://localhost:3000"
18-
echo "Astro dev server: http://localhost:4321 (with live reload)"
19-
echo "Main development URL: http://localhost:4321"
17+
echo "Ruby server: http://localhost:4000"
18+
echo "Astro dev server: http://localhost:4001 (with live reload)"
19+
echo "Main development URL: http://localhost:4001"
2020
echo ""
2121

2222
# Function to cleanup background processes
@@ -38,7 +38,7 @@ trap cleanup SIGINT SIGTERM
3838

3939
# Start Ruby server in background
4040
echo "Starting Ruby server..."
41-
bundle exec puma -p ${PORT:-3000} -C config/puma.rb &
41+
bundle exec puma -p ${PORT:-4000} -C config/puma.rb &
4242
RUBY_PID=$!
4343

4444
# Wait a moment for Ruby server to start

docker-compose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ services:
66
image: gilcreator/html2rss-web
77
restart: unless-stopped
88
ports:
9-
- "127.0.0.1:3000:3000"
9+
- "127.0.0.1:4000:4000"
1010
volumes:
1111
- type: bind
1212
source: ./config/feeds.yml
1313
target: /app/config/feeds.yml
1414
read_only: true
1515
environment:
1616
RACK_ENV: production
17+
PORT: 4000
1718
HTML2RSS_SECRET_KEY: your-generated-secret-key-here
1819
HEALTH_CHECK_TOKEN: health-check-token-xyz789
19-
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:3001
20+
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
2021
BROWSERLESS_IO_API_TOKEN: 6R0W53R135510
2122

2223
watchtower:
@@ -30,7 +31,9 @@ services:
3031
browserless:
3132
image: "ghcr.io/browserless/chromium"
3233
restart: unless-stopped
34+
ports:
35+
- "127.0.0.1:4002:4002"
3336
environment:
34-
PORT: 3001
37+
PORT: 4002
3538
CONCURRENT: 10
3639
TOKEN: 6R0W53R135510

frontend/astro.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import preact from "@astrojs/preact";
55
export default defineConfig({
66
output: "static",
77
server: {
8-
port: 3001,
8+
port: 4001,
99
host: true,
1010
},
1111
vite: {
1212
server: {
1313
proxy: {
14-
"/api": "http://localhost:3000",
15-
"/rss.xsl": "http://localhost:3000",
14+
"/api": "http://localhost:4000",
15+
"/rss.xsl": "http://localhost:4000",
1616
},
1717
},
1818
},

0 commit comments

Comments
 (0)