Skip to content

fix doc md error #2

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dockerfile/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM postgres:16.3-bullseye

# 替换apt源
RUN cat /etc/apt/sources.list
RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN cat /etc/apt/sources.list

# 更新包索引并安装git
RUN apt-get update && apt-get install -y \
build-essential \
git \
postgresql-server-dev-all \
&& rm -rf /var/lib/apt/lists/*

# 维护者信息
MAINTAINER xuzhijvn

RUN cd /tmp \
&& git clone --branch v0.7.0 https://github.com/pgvector/pgvector.git \
&& cd pgvector \
&& make \
&& make install
13 changes: 13 additions & 0 deletions Dockerfile/postgresql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### 使用示例命令

1. 拉取 https://gitee.com/plumeorg/plumelog 代码
2. 打包 plumelog-server ( tips: 打包时需要注释`application.properties`配置文件内容,这样外部配置文件才会生效... )
3. 执行以下命令制作镜像

```shell
# 打包镜像 -f:指定Dockerfile文件路径 --no-cache:构建镜像时不使用缓存
docker build -f Dockerfile -t "ccr.ccs.tencentyun.com/xuzhijun/postgresql:16.3-pgvector" . --no-cache

# 推送镜像
docker push ccr.ccs.tencentyun.com/xuzhijun/postgresql:16.3-pgvector
```
2 changes: 1 addition & 1 deletion Dockerfile/小知识.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile

- `ARG` 参数仅在图像构建期间可用
- `ARG` 参数仅在镜像构建期间可用
- `ENV` 变量在构建期间和容器中都可用
- `CMD` 在容器启动时执行,其中的`ARG`变量不再可用,若需要动态变量值应使用`ENV`

Expand Down
20 changes: 20 additions & 0 deletions Linux/postgresql/docker-compose_my.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3'
services:
postgresql:
image: ccr.ccs.tencentyun.com/xuzhijun/postgresql:16.3-pgvector # 镜像'postgres:16.3'
container_name: postgresql # 容器名为'postgresql'
restart: unless-stopped # 指定容器退出后的重启策略为始终重启,但是不考虑在Docker守护进程启动时就已经停止了的容器
# 设置环境变量,相当于docker run命令中的-e
environment:
TZ: Asia/Shanghai
LANG: en_US.UTF-8
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123456
ALLOW_IP_RANGE: 0.0.0.0/0 # 允许所有ip访问
# 数据卷挂载路径设置,将本机目录映射到容器目录
volumes:
- "./postgresql/16_3/data:/var/lib/postgresql/16_3/data"
# 映射端口
ports:
- "5432:5432"