Skip to content

Commit 3005245

Browse files
[fix] guide issues
1 parent 578509e commit 3005245

File tree

4 files changed

+86
-86
lines changed

4 files changed

+86
-86
lines changed

content/guides/nodejs/configure-github-actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ To enable GitHub Actions to build and push Docker images, you'll securely store
3737

3838
### Step 1: Connect your GitHub repository to Docker Hub
3939

40-
1. Create a Personal Access Token (PAT) from [Docker Hub](https://hub.docker.com)
40+
1. Create a Personal Access Token (PAT) from [Docker Hub](https://hub.docker.com).
4141
1. Go to your **Docker Hub account → Account Settings → Security**.
4242
2. Generate a new Access Token with **Read/Write** permissions.
4343
3. Name it something like `docker-nodejs-sample`.
4444
4. Copy and save the token — you'll need it in Step 4.
4545

46-
2. Create a repository in [Docker Hub](https://hub.docker.com/repositories/)
46+
2. Create a repository in [Docker Hub](https://hub.docker.com/repositories/).
4747
1. Go to your **Docker Hub account → Create a repository**.
4848
2. For the Repository Name, use something descriptive — for example: `nodejs-sample`.
4949
3. Once created, copy and save the repository name — you'll need it in Step 4.
5050

51-
3. Create a new [GitHub repository](https://github.com/new) for your Node.js project
51+
3. Create a new [GitHub repository](https://github.com/new) for your Node.js project.
5252

5353
4. Add Docker Hub credentials as GitHub repository secrets.
5454

content/guides/nodejs/containerize.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,16 +644,16 @@ This Dockerfile implements several strategies to minimize the final image size:
644644

645645
**Expected size reduction**: ~50% smaller than standard Node.js images
646646

647-
### Step 3: Configure the .dockerignore file
647+
### Step 2: Configure the .dockerignore file
648648

649649
The `.dockerignore` file tells Docker which files and folders to exclude when building the image.
650650

651651
> [!NOTE]
652652
> This helps:
653653
>
654-
> 1.Reduce image size
655-
> 2.Speed up the build process
656-
> 3.Prevent sensitive or unnecessary files (like `.env`, `.git`, or `node_modules`) from being added to the final image.
654+
> - Reduce image size
655+
> - Speed up the build process
656+
> - Prevent sensitive or unnecessary files (like `.env`, `.git`, or `node_modules`) from being added to the final image.
657657
>
658658
> To learn more, visit the [.dockerignore reference](/reference/dockerfile.md#dockerignore-file).
659659

@@ -705,7 +705,7 @@ nodejs-sample-kubernetes.yaml
705705
!tsconfig.json
706706
```
707707

708-
### Step 4: Build the Node.js application image
708+
### Step 3: Build the Node.js application image
709709

710710
After creating all the configuration files, your project directory should now contain all necessary Docker configuration files:
711711

@@ -735,7 +735,7 @@ What this command does:
735735
- Packages the application and its dependencies into a Docker image
736736
- Tags the image as docker-nodejs-sample so you can reference it later
737737

738-
#### Step 6: View local images
738+
#### Step 4: View local images
739739

740740
After building your Docker image, you can check which images are available on your local machine using either the Docker CLI or [Docker Desktop](/manuals/desktop/use-desktop/images.md). Since you're already working in the terminal, let's use the Docker CLI.
741741

content/guides/nodejs/develop.md

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ networks:
166166

167167
1. The PostgreSQL database configuration is handled automatically by the application. The database is created and initialized when the application starts, with data persisted using the `postgres_data` volume.
168168

169-
2. Configure your environment by copying the example file:
169+
1. Configure your environment by copying the example file:
170170

171171
```console
172172
$ cp .env.example .env
@@ -192,25 +192,25 @@ networks:
192192
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
193193
```
194194

195-
3. Run the following command to start your application in development mode:
195+
1. Run the following command to start your application in development mode:
196196

197197
```console
198198
$ docker compose up app-dev --build
199199
```
200200

201-
4. Open a browser and verify that the application is running at [http://localhost:5173](http://localhost:5173) for the frontend or [http://localhost:3000](http://localhost:3000) for the API. The React frontend is served by Vite dev server on port 5173, with API calls proxied to the Express server on port 3000.
201+
1. Open a browser and verify that the application is running at [http://localhost:5173](http://localhost:5173) for the frontend or [http://localhost:3000](http://localhost:3000) for the API. The React frontend is served by Vite dev server on port 5173, with API calls proxied to the Express server on port 3000.
202202

203-
5. Add some items to the todo list to test data persistence.
203+
1. Add some items to the todo list to test data persistence.
204204

205-
6. After adding some items to the todo list, press `CTRL + C` in the terminal to stop your application.
205+
1. After adding some items to the todo list, press `CTRL + C` in the terminal to stop your application.
206206

207-
7. Run the application again:
207+
1. Run the application again:
208208

209-
```console
210-
$ docker compose up app-dev
211-
```
209+
```console
210+
$ docker compose up app-dev
211+
```
212212

213-
8. Refresh [http://localhost:5173](http://localhost:5173) in your browser and verify that the todo items persisted, even after the containers were removed and ran again.
213+
1. Refresh [http://localhost:5173](http://localhost:5173) in your browser and verify that the todo items persisted, even after the containers were removed and ran again.
214214

215215
## Configure and run a development container
216216

@@ -355,7 +355,7 @@ $ npm run db:start # Start PostgreSQL container
355355
$ npm run dev # Start both server and client
356356
```
357357

358-
### Using Task Runner (Alternative)
358+
### Using Task Runner (alternative)
359359

360360
The project includes a comprehensive Taskfile.yml for advanced workflows:
361361

@@ -397,55 +397,55 @@ Any changes to the application's source files on your local machine will now be
397397
Try making a change to test hot reloading:
398398

399399
1. Open `src/client/components/TodoApp.tsx` in an IDE or text editor
400-
2. Update the main heading text:
401-
402-
```diff
403-
- <h1 className="text-3xl font-bold text-gray-900 mb-8">
404-
- Modern Todo App
405-
- </h1>
406-
+ <h1 className="text-3xl font-bold text-gray-900 mb-8">
407-
+ My Todo App
408-
+ </h1>
409-
```
400+
1. Update the main heading text:
401+
402+
```diff
403+
- <h1 className="text-3xl font-bold text-gray-900 mb-8">
404+
- Modern Todo App
405+
- </h1>
406+
+ <h1 className="text-3xl font-bold text-gray-900 mb-8">
407+
+ My Todo App
408+
+ </h1>
409+
```
410410

411411
1. Save the file and the Vite dev server will automatically reload the page with your changes
412412

413-
**Debugging Support:**
413+
**Debugging support:**
414414

415415
You can connect a debugger to your application on port 9229. The Node.js inspector is enabled with `--inspect=0.0.0.0:9230` in the development script (`dev:server`).
416416

417-
### VS Code Debugger Setup
417+
### VS Code debugger setup
418418

419-
1. **Create a launch configuration** in `.vscode/launch.json`:
419+
1. Create a launch configuration in `.vscode/launch.json`:
420420

421-
```json
422-
{
423-
"version": "0.2.0",
424-
"configurations": [
421+
```json
425422
{
426-
"name": "Attach to Docker Container",
427-
"type": "node",
428-
"request": "attach",
429-
"port": 9229,
430-
"address": "localhost",
431-
"localRoot": "${workspaceFolder}",
432-
"remoteRoot": "/app",
433-
"protocol": "inspector",
434-
"restart": true,
435-
"sourceMaps": true,
436-
"skipFiles": ["<node_internals>/**"]
423+
"version": "0.2.0",
424+
"configurations": [
425+
{
426+
"name": "Attach to Docker Container",
427+
"type": "node",
428+
"request": "attach",
429+
"port": 9229,
430+
"address": "localhost",
431+
"localRoot": "${workspaceFolder}",
432+
"remoteRoot": "/app",
433+
"protocol": "inspector",
434+
"restart": true,
435+
"sourceMaps": true,
436+
"skipFiles": ["<node_internals>/**"]
437+
}
438+
]
437439
}
438-
]
439-
}
440440
```
441441

442-
1. **Start your development container**:
442+
1. Start your development container:
443443

444-
```console
445-
docker compose up app-dev --build
446-
```
444+
```console
445+
docker compose up app-dev --build
446+
```
447447

448-
1. **Attach the debugger**:
448+
1. Attach the debugger:
449449
- Open VS Code
450450
- Go to the Debug panel (Ctrl/Cmd + Shift + D)
451451
- Select "Attach to Docker Container" from the drop-down
@@ -455,27 +455,27 @@ docker compose up app-dev --build
455455

456456
You can also use Chrome DevTools for debugging:
457457

458-
1. **Start your container** (if not already running):
458+
1. Start your container (if not already running):
459459

460-
```console
461-
docker compose up app-dev --build
462-
```
460+
```console
461+
docker compose up app-dev --build
462+
```
463463

464-
1. **Open Chrome** and navigate to:
464+
1. Open Chrome and navigate to:
465465

466-
```text
467-
chrome://inspect
468-
```
466+
```text
467+
chrome://inspect
468+
```
469469

470-
1. **Select "Configure"** and add:
470+
1. Select **Configure** and add:
471471

472-
```text
473-
localhost:9229
474-
```
472+
```text
473+
localhost:9229
474+
```
475475

476-
1. **Select "inspect"** under your Node.js target when it appears
476+
1. Select **inspect** under your Node.js target when it appears.
477477

478-
### Debugging Configuration Details
478+
### Debugging configuration details
479479

480480
The debugger configuration:
481481

@@ -485,32 +485,32 @@ The debugger configuration:
485485

486486
The debugger listens on all interfaces (`0.0.0.0`) inside the container on port 9230 and is accessible on port 9229 from your host machine.
487487

488-
### Troubleshooting Debugger Connection
488+
### Troubleshooting debugger connection
489489

490490
If the debugger doesn't connect:
491491

492-
1. **Check if the container is running**:
492+
1. Check if the container is running:
493493

494-
```console
495-
docker ps
496-
```
494+
```console
495+
docker ps
496+
```
497497

498-
1. **Check if the port is exposed**:
498+
1. Check if the port is exposed:
499499

500-
```console
501-
docker port todoapp-dev
502-
```
500+
```console
501+
docker port todoapp-dev
502+
```
503503

504-
1. **Check container logs**:
504+
1. Check container logs:
505505

506-
```console
507-
docker compose logs app-dev
508-
```
506+
```console
507+
docker compose logs app-dev
508+
```
509509

510-
You should see a message like:
510+
You should see a message like:
511511

512-
```text
513-
Debugger listening on ws://0.0.0.0:9230/...
512+
```text
513+
Debugger listening on ws://0.0.0.0:9230/...
514514
```
515515

516516
Now you can set breakpoints in your TypeScript source files and debug your containerized Node.js application!

content/guides/nodejs/run-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ You should see output like the following:
122122
Duration 1.98s (transform 456ms, setup 1.26s, collect 1.74s, tests 1.87s, environment 5.82s, prepare 916ms)
123123
```
124124

125-
### Test Structure
125+
### Test structure
126126

127127
The test suite covers:
128128

0 commit comments

Comments
 (0)