-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (43 loc) · 1.06 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
services:
postgres:
build:
context: .
dockerfile: Dockerfile.postgres
container_name: local_postgres
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
LC_CTYPE: en_US.UTF-8
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init:/docker-entrypoint-initdb.d
networks:
- app-network
db_init:
image: postgres:15.3
depends_on:
- postgres
volumes:
- ./init:/docker-entrypoint-initdb.d
entrypoint:
[
"bash",
"-c",
"until pg_isready -h postgres -U myuser; do echo 'Waiting for Postgres...'; sleep 2; done; psql -h postgres -U myuser -d mydatabase -f /docker-entrypoint-initdb.d/create_pgvector_extension.sql",
]
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
networks:
- app-network
volumes:
postgres_data:
networks:
app-network:
driver: bridge