V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要把任何和邀请码有关的内容发到 NAS 节点。

邀请码相关的内容请使用 /go/in 节点。
nbweb
V2EX  ›  NAS

求助: docker 安装 joplin 如何使用现有的 postgresql

  •  
  •   nbweb · 1 天前 · 374 次点击
    目前要安装 joplin ,需要使用到 postgresql ,但 postgresql 之前安装 immich 时已有了,如下:
    ```
    docker run -d \
    --name=postgres14 \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_DB=postgres_db \
    -v /usr/local/etc/docker/postgresql:/var/lib/postgresql/data \
    -p 5432:5432 \
    tensorchord/pgvecto-rs:pg14-v0.2.0
    ```

    那么在安装 joplin 时,如何连这个 postgresql ?
    docker-cli 如下,哪位高手帮修改下,谢谢!

    ```
    docker run -d \
    --name joplin-server \
    -p 22300:22300 \
    -e APP_PORT=22300 \
    -e APP_BASE_URL=http://10.0.0.3 \
    -e DB_CLIENT=pg \
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_DATABASE=joplin_db \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_PORT=5432 \
    -e POSTGRES_HOST=10.0.0.3 \
    joplin/server:latest
    ```
    8 条回复
    loocao
        1
    loocao  
       1 天前
    POSTGRES_HOST 改成 172.17.0.1 试试
    GivingX
        2
    GivingX  
       23 小时 31 分钟前
    version: '3'
    services:
    joplin_server:
    image: joplin/server:latest
    container_name: joplin_server
    ports:
    - 8752:8752
    restart: unless-stopped
    environment:
    - APP_PORT=8752
    - APP_BASE_URL=http://xxx.com
    - DB_CLIENT=pg
    - POSTGRES_PASSWORD=rrrrrrr
    - POSTGRES_DATABASE=joplin
    - POSTGRES_USER=postgres_db
    - POSTGRES_PORT=5432
    - POSTGRES_HOST=数据库服务地址
    GivingX
        3
    GivingX  
       23 小时 29 分钟前
    我的用的是 docker-compose.yml
    mnday
        4
    mnday  
       23 小时 27 分钟前
    个人不建议用 ip 方式连接。建议把容器放到同一 docker 网络内,使用容器的名字连接会更稳定一点
    conglovely
        5
    conglovely  
       22 小时 49 分钟前
    我是安装黑群现成的套件,然后用 webdav 同步,挺方便的...
    nbweb
        6
    nbweb  
    OP
       22 小时 43 分钟前
    @GivingX 感谢,关键是我在 docker 里已经跑了一个 postgres 了,POSTGRES_HOST=数据库服务地址,这个地址,是写 10.0.0.3 ,还是写 172.17.0.7 ( postgres 容器的地址)?
    SayHeya
        7
    SayHeya  
       21 小时 57 分钟前
    docker inspect [pg 容器名] 查看网络 ip ,然后 POSTGRES_HOST=网络 ip
    nbweb
        8
    nbweb  
    OP
       19 小时 21 分钟前
    @GivingX 谢谢,已好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2758 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 07:53 · PVG 15:53 · LAX 00:53 · JFK 03:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.