-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (39 loc) · 1.69 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
45
# Based on debian-slim
FROM postgres:12
RUN mkdir -p /app
RUN apt-get update
# pgroonga extension
# Does not officially support alpine
RUN apt-get install -y curl
RUN curl -O https://packages.groonga.org/debian/groonga-apt-source-latest-buster.deb
RUN apt-get install -y ./groonga-apt-source-latest-buster.deb
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y postgresql-12-pgdg-pgroonga
RUN apt-get install -y groonga-tokenizer-mecab
RUN apt-get install -y groonga-token-filter-stem
# postgres-json-schema extension
WORKDIR /app
RUN apt-get install -y git make
RUN git clone --depth 1 https://github.com/gavinwahl/postgres-json-schema.git
RUN cd postgres-json-schema && make install
# pg_jieba extension
WORKDIR /app
RUN apt-get install -y cmake build-essential postgresql-server-dev-12
RUN git clone --depth 1 https://github.com/jaiminpan/pg_jieba.git
WORKDIR /app/pg_jieba
RUN git submodule update --init --recursive
RUN mkdir build && cd build && cmake -DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/12/server .. && make && make install
# nodejs14
# Install nodejs 14
WORKDIR /app
RUN apt-get install -y dirmngr apt-transport-https lsb-release ca-certificates
RUN curl -sSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs gcc g++ make
RUN npm i -g yarn
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile
RUN yarn build
RUN node -e 'const pkg = require("./package.json"); delete pkg.devDependencies; require("fs").writeFileSync("./package.json", JSON.stringify(pkg))'
RUN yarn --frozen-lockfile