更新 部署PostGIS.md

This commit is contained in:
8ga
2026-03-02 13:32:33 +08:00
parent cb31791842
commit cd83e76df3

View File

@@ -58,4 +58,58 @@ services:
# PGADMIN_SERVER_CERT_FILE: /certs/server.cert
# PGADMIN_SERVER_KEY_FILE: /certs/server.key
# restart: on-failure:3
```
## 添加全文索引支持
需要从 git 克隆 zhparser 添加中文分词支持,执行 docker build 命令的目录结构长这样:
- Dockerfile
- zhparser/
```bash
git clone https://github.com/amutu/zhparser.git
```
```bash
FROM postgis/postgis:16-master
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
git \
libcurl4-openssl-dev \
libxml2-dev \
wget \
postgresql-server-dev-16 \
&& rm -rf /var/lib/apt/lists/*
RUN pg_config --version
WORKDIR /tmp
RUN wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2 \
&& tar xjf scws-1.2.3.tar.bz2 \
&& cd scws-1.2.3 \
&& ./configure \
&& make && make install \
&& cd ..
COPY zhparser zhparser
RUN cd zhparser \
&& export PG_CONFIG=$(which pg_config) \
&& echo "Using pg_config: $PG_CONFIG" \
&& make USE_PGXS=1 \
&& make USE_PGXS=1 install \
&& cd ..
RUN rm -rf /tmp/*
WORKDIR /
```
```bash
docker build -t pgsql-gis-fts .
```