Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: 在docker中新建容器并使用映射时,映射文件夹koishi可以不为空 #34

Open
borraken opened this issue Jul 11, 2024 · 3 comments

Comments

@borraken
Copy link

borraken commented Jul 11, 2024

Describe the problem related to the feature request

docker部署的koishi本体突然不好使了,就想着干脆重新新建一个,并把原来的koishi.yml和db文件直接映射过去,结果新建后容器不断重启。
image

compose.yml

version: "3"
services:
  koishi:
    image: koishijs/koishi:v1.14.7
    container_name: koishi2
    volumes:
      - /volume1/docker/koishi2/koishi.yml:/koishi/koishi.yml:rw
      - /volume1/docker/koishi2/koishi.db:/koishi/data/koishi.db:rw
    # ports:
    #   - "5140:5140"
    restart: always
    network_mode: "host"
    environment:      
      HTTP_PROXY: 'http://127.0.0.1:7890'
      HTTPS_PROXY: 'http://127.0.0.1:7890'
      NO_PROXY: '127.0.0.1,localhost,*.test.lan'

Describe the solution you'd like

rt

Describe alternatives you've considered

No response

Additional context

No response

@Anillc
Copy link
Member

Anillc commented Jul 17, 2024

你可以先保持映射的文件夹为空,等启动脚本解压完成过后再将你的文件拷贝进去

主要是考虑跳过文件或者覆盖文件都不一定是很好的选择,有迁移的需求最好还是自己手动操作一下,避免出现问题

@shigma
Copy link
Member

shigma commented Jul 17, 2024

将此 issue 转移到 boilerplate 仓库。

顺便,如果需要迁移实例建议保持以下文件:

  • .env(如果存在)
  • koishi.yml
  • package.json
  • 整个 data 目录

@shigma shigma transferred this issue from koishijs/koishi Jul 17, 2024
@H4M5TER
Copy link
Member

H4M5TER commented Aug 12, 2024

我不反对跳过已有,已有肯定是用户自己进行了额外操作的情况

如果要跳过已有的话,给 unzip 加个 -n 应该就可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants