更新 部署PostGIS.md
This commit is contained in:
54
部署PostGIS.md
54
部署PostGIS.md
@@ -59,3 +59,57 @@ services:
|
||||
# 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 .
|
||||
```
|
||||
Reference in New Issue
Block a user