forked from appotry/postgres-chinese-textsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (27 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM postgres:15-alpine
RUN set -ex \
&& apk add --no-cache --virtual .build-deps gcc libc-dev make pkgconf clang15 llvm15 cmake g++\
&& apk add --no-cache git build-base linux-headers make postgresql-dev automake libtool autoconf m4 \
&& wget -q -O - "https://github.com/hightman/scws/archive/master.tar.gz" | tar zxf - \
&& wget -q -O - "https://github.com/amutu/zhparser/archive/master.tar.gz" | tar zxf - \
&& wget -q -O - "https://github.com/jaiminpan/pg_jieba/archive/master.tar.gz" | tar zxf - \
&& git clone --depth=1 --branch=master https://github.com/yanyiwu/cppjieba.git \
&& cd cppjieba \
&& git submodule init && git submodule update \
&& cd /scws-master \
&& touch README;aclocal;autoconf;autoheader;libtoolize;automake --add-missing \
&& ./configure \
&& make install \
&& cd /zhparser-master \
&& make \
&& make install \
&& mv /cppjieba/* /pg_jieba-master/libjieba \
&& mkdir /pg_jieba-master/build \
&& cd /pg_jieba-master/build \
&& cmake .. \
&& make \
&& make install \
&& echo "echo \"shared_preload_libraries = 'pg_jieba.so'\" >> /var/lib/postgresql/data/postgresql.conf" > /docker-entrypoint-initdb.d/load-lib.sh \
&& apk del .build-deps \
&& rm -rf /zhparser-master /scws-master /cppjieba /pg_jieba-master
COPY install_extension.sql init_extension.sh /docker-entrypoint-initdb.d/