-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
44 lines (40 loc) · 1.32 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM postgres:14-bullseye
LABEL maintainer="loyayz - https://loyayz.com"
ENV SCWS_URL http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2
ENV ZHPARSER_URL https://github.com/amutu/zhparser/archive/refs/heads/master.tar.gz
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
wget \
bzip2 \
make \
gcc \
libc6-dev \
postgresql-server-dev-$PG_MAJOR \
\
## install scws
&& cd / \
&& wget -q -O - $SCWS_URL | tar xjf - \
&& SCWS_DIR=${SCWS_URL##*/} \
&& SCWS_DIR=${SCWS_DIR%%.tar*} \
&& cd $SCWS_DIR && ./configure && make install \
## install zhparser
&& cd / \
&& wget -q -O - $ZHPARSER_URL | tar xzf - \
&& cd zhparser-master && make install \
# clean
&& apt-get purge -y \
ca-certificates \
wget \
bzip2 \
make \
gcc \
libc6-dev \
postgresql-server-dev-$PG_MAJOR \
&& apt-get autoremove --purge -y \
&& rm -rf /$SCWS_DIR \
/zhparser-master \
/var/lib/apt/lists/*
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./load-extensions.sh /docker-entrypoint-initdb.d/10_zhparser.sh
RUN chmod 755 /docker-entrypoint-initdb.d/10_zhparser.sh