-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
38 lines (34 loc) · 1.44 KB
/
docker-compose.yaml
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
version: '3.5'
#
# [IMPORTANT] `container_name` properties are prefixed by the project name to avoid conflicting with other project volumes
#
services:
postgres:
container_name: etabli_postgres_container_${DOCKER_COMPOSE_CONTAINER_NAME_SUFFIX:-default}
# image: postgres:15.5
image: ankane/pgvector:v0.5.1 # It uses `postgres:15` including the `vector` extension, using it for local purpose (the provider Clever Cloud we chose also has this extension by default into their Postgres instances)
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- '${DOCKER_COMPOSE_POSTGRES_PORT_BINDING:-5432:5432}'
networks:
- postgres
restart: unless-stopped
healthcheck:
# Note: at start we tried `pg_isready` but it's not efficient since the postgres container restarts the server at startup (to init some scripts) so we ended with broken connections...
# The best is to try a real query to be sure it's up and running as advised in https://github.com/docker-library/postgres/issues/146#issuecomment-872486465
test: ['CMD-SHELL', 'psql -h localhost -U $${POSTGRES_USER} -c select 1 -d $${POSTGRES_DB}']
interval: 1s
timeout: 3s
retries: 5
networks:
postgres:
driver: bridge
volumes:
postgres:
pgadmin: