-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.compose.yml
More file actions
104 lines (97 loc) · 3.57 KB
/
Copy pathdatabase.compose.yml
File metadata and controls
104 lines (97 loc) · 3.57 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: ${INKCRE_COMPOSE_PROJECT_NAME:?INKCRE_COMPOSE_PROJECT_NAME is required}
services:
postgres:
image: pgvector/pgvector:pg17@sha256:d2ef61f42ef767baa5a1475393303cc235bcd92febd9d7014eddb48b41f3bad0
environment:
POSTGRES_DB: inkcre
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
POSTGRES_USER: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- '127.0.0.1:${POSTGRES_PORT:-0}:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d inkcre']
interval: 2s
timeout: 3s
retries: 30
contract:
image: ${INKCRE_CORE_IMAGE:?INKCRE_CORE_IMAGE is required}
user: '0:0'
command: ['sh', '-eu', '-c', 'cp -R /app/database-contract/. /database-contract/']
volumes:
- database-contract:/database-contract
restore:
image: pgvector/pgvector:pg17@sha256:d2ef61f42ef767baa5a1475393303cc235bcd92febd9d7014eddb48b41f3bad0
entrypoint: ['sh', '-eu', '-c']
command:
- >-
psql -v ON_ERROR_STOP=1 -h postgres -U postgres -d inkcre
< /database-contract/database-roles.sql
&& psql -v ON_ERROR_STOP=1 -h postgres -U postgres -d inkcre
< /database-contract/database-schema.sql
depends_on:
contract:
condition: service_completed_successfully
postgres:
condition: service_healthy
environment:
PGPASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes:
- database-contract:/database-contract:ro
init:
image: ${INKCRE_CORE_IMAGE:?INKCRE_CORE_IMAGE is required}
command: ['python', 'scripts/container.py', 'db', 'init', '--profile', 'development']
depends_on:
restore:
condition: service_completed_successfully
environment:
CORE_DATABASE_PASSWORD: ${CORE_DATABASE_PASSWORD:?CORE_DATABASE_PASSWORD is required}
MIGRATION_DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD}@postgres:5432/inkcre
POSTGREST_DATABASE_PASSWORD: ${POSTGREST_DATABASE_PASSWORD:?POSTGREST_DATABASE_PASSWORD is required}
core:
image: ${INKCRE_CORE_IMAGE:?INKCRE_CORE_IMAGE is required}
command: ['python', 'scripts/container.py', 'web']
depends_on:
init:
condition: service_completed_successfully
environment:
DATABASE_URL: postgresql+psycopg://inkcre_core:${CORE_DATABASE_PASSWORD}@postgres:5432/inkcre
INKCRE_ENV_FILE: ''
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
OBSRV__LOGGING_BACKEND: none
PEER_ID: 00000000-0000-4000-8000-000000000002
PEER_LEASE_RENEW_INTERVAL_SECONDS: 1
PEER_NAME: core-py-development
PORT: 8000
ports:
- '127.0.0.1:${CORE_PORT:-0}:8000'
healthcheck:
test:
[
'CMD',
'python',
'-c',
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/readyz')",
]
interval: 3s
timeout: 3s
retries: 30
postgrest:
image: postgrest/postgrest:v14.15@sha256:2f8e7b656f09db697a8875177694b417b35cb76c21370de07fc54e711e902326
depends_on:
init:
condition: service_completed_successfully
environment:
PGRST_DB_ANON_ROLE: anonymous
PGRST_DB_PRE_REQUEST: inkcre_internal.check_jwt
PGRST_DB_SCHEMAS: inkcre
PGRST_DB_URI: postgresql://authenticator:${POSTGREST_DATABASE_PASSWORD}@postgres:5432/inkcre
PGRST_JWT_AUD: inkcre-api
PGRST_JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
PGRST_SERVER_PORT: 3000
ports:
- '127.0.0.1:${POSTGREST_PORT:-0}:3000'
volumes:
database-contract:
postgres_data: