-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
50 lines (45 loc) · 1.58 KB
/
docker-compose.yml
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
46
47
48
49
50
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
LANG: C.UTF-8
LC_ALL: C.UTF-8
volumes:
- postgres_data:/var/lib/postgresql/data
- .:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 300s
timeout: 300s
retries: 10
start_period: 120s
ports:
- "5432:5432"
command: >
bash -c "
# Install dependencies
apt-get update &&
apt-get install -y flex bison git build-essential postgresql-server-dev-16 cmake pkg-config libxml2-dev postgresql-contrib &&
# Setup bison
which bison &&
ln -s /usr/bin/bison /usr/local/bin/bison &&
# Install AGE
cd /tmp &&
rm -rf age &&
git clone https://github.com/apache/age.git &&
cd age &&
git checkout PG16 &&
USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config make clean &&
USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config make &&
USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config make install &&
# Copy ALL SQL files
cp /tmp/age/sql/*.sql /usr/share/postgresql/16/extension/ &&
cp /tmp/age/*.sql /usr/share/postgresql/16/extension/ &&
cp /tmp/age/age.control /usr/share/postgresql/16/extension/ &&
# Start PostgreSQL
docker-entrypoint.sh postgres"
volumes:
postgres_data: