# Node.js

## 基本信息

[Node.js](https://en.wikipedia.org/wiki/Node.js) 是基于 JavaScript 的可扩展服务端和网络软件开发平台。

该仓库位于 `https://hub.docker.com/_/node/`。具体可用版本以 Docker Hub 上的 tags 列表为准。

## 使用方法

在项目中创建一个 Dockerfile。

```docker
FROM node:22

## replace this with your application's default port

EXPOSE 8888
```

然后创建镜像，并启动容器。

```bash
$ docker build -t my-nodejs-app
$ docker run -it --rm --name my-running-app my-nodejs-app
```

也可以直接运行一个简单容器。

```bash
$ docker run -it --rm \
    --name my-running-script \
    # -v "$ ":/usr/src/myapp \

    --mount type=bind,src="$(pwd)",target=/usr/src/myapp \
    -w /usr/src/myapp \
    node:22-alpine \
    node your-daemon-or-script.js
```

## Dockerfile

请到 [Node 官方镜像文档目录](https://github.com/docker-library/docs/tree/master/node) 查看。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/docker_practice/fu-lu/appendix/repo/nodejs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
