Files
qwqcode bad248534c docs: revise and add more examples
BREAKING CHANGE: The following top-level functions exported by the 'artalk' npm package have been deprecated: `Artalk.update`, `Artalk.reload`, and `Artalk.destroy`. These methods now require invocation on an instance created by either `Artalk.init` or `new Artalk`. Please utilize instance-level methods instead, such as `artalkInstance.update`. For more information, refer to  [the documentation](https://artalk.js.org/guide/frontend/import-framework.html). The update was implemented to enable the concurrent creation of multiple instances, adapting to situations where Vue components are simultaneously referenced across various pages. Initially, only a singular instance was permitted to mitigate memory leak concerns. However, this proved limiting for scenarios involving the caching of multiple component instances through 'keep-alive.' To better suit intricate SPA application needs, the choice was made to permit the creation of multiple independent instances. It's crucial to remember to manually invoke the `artalk.destroy` method when releasing components to avoid memory leaks (Issue #660).
2023-12-17 19:16:33 +08:00

2.1 KiB

Docker

Artalk 提供后端程序的 Docker 镜像,以便加速部署流程,提供一个良好的部署体验。

Docker Hub 镜像版本随代码仓库的 Releases 保持同步。

镜像拉取

docker pull artalk/artalk-go

容器创建

:::tip

推荐使用 Docker Compose,可参考 程序部署 页面的步骤。

:::

Docker 容器创建:

# 为 Artalk 创建一个目录
mkdir Artalk
cd Artalk

# 拉取 docker 镜像
docker pull artalk/artalk-go

# 生成配置文件
docker run -it -v $(pwd)/data:/data --rm artalk/artalk-go gen config data/artalk.yml

# 编辑配置文件
vim data/artalk.yml

# 运行 docker 容器
docker run -d \
  --name artalk \
  -p 0.0.0.0:8080:23366 \
  -v $(pwd)/data:/data \
  artalk/artalk-go

然后,在前端配置填入后端地址:

Artalk.init({ server: "http://your_domain:8080" })

重启

修改配置文件后,需要重启才能生效。

# Docker Compose
docker-compose restart

# Docker
docker restart artalk

停止

# Docker Compose
docker-compose stop

# Docker
docker stop artalk

升级

删除现有容器,拉取最新镜像,然后重新创建容器即可。

Docker Compose

docker-compose down
docker-compose pull
docker-compose up -d

Docker

docker stop artalk
docker rm artalk
docker pull artalk/artalk-go

::: tip 突破性变动请注意查看版本更新日志中的提示:CHANGELOG.md :::

拉取历史镜像

镜像会随代码仓库 tags 自动构建发布,您可拉取不同版本号的镜像。

docker pull artalk/artalk-go@版本号

进入容器

# Docker Compose
docker-compose exec artalk bash

# Docker
docker exec -it artalk bash

多平台兼容性

Docker 镜像暂仅提供 x86、arm64 的镜像构建,如需更多平台架构版本,请下载 二进制构建部署。