-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.dev.yml
executable file
·106 lines (100 loc) · 2.74 KB
/
docker-compose.dev.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
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
105
106
#!/usr/bin/env -S docker compose -f
services:
# Since this project is a PNPM workspace, but the
# containers run separate subpackages, this service
# installs their dependencies into Docker volumes.
pnpmi:
user: "root"
network_mode: host
image: ghcr.io/hackbg/undexer:v4
build: { context: ., network: host }
environment: { CI: 1 }
entrypoint: /bin/sh
command: >
-c "for d in /src/undexer /src/undexer/fadroma; do
cd $$d
pwd
chown -R node node_modules
su node -c 'pnpm i'
done"
volumes: # Volume order is important:
- deps:/app/.pnpm-store # First the volumes...
- deps-undexer:/src/undexer/node_modules
- deps-fadroma:/src/undexer/fadroma/node_modules
- .:/src/undexer
# API service serves data from database.
api:
network_mode: host
restart: unless-stopped
image: ghcr.io/hackbg/undexer:v4
build: { context: ., network: host }
entrypoint: /app/undexer
command: api
volumes:
- deps-undexer:/app/node_modules
- deps-fadroma:/app/fadroma/node_modules
- .:/app
depends_on:
pnpmi:
condition: service_completed_successfully
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -O- localhost:8888/v2/status"]
interval: 1s
timeout: 5s
retries: 5
# Indexer stores data from remote chain into local database.
indexer:
network_mode: host
restart: unless-stopped
image: ghcr.io/hackbg/undexer:v4
build: { context: ., network: host }
entrypoint: /app/undexer
command: index
volumes:
- deps-undexer:/app/node_modules
- deps-fadroma:/app/fadroma/node_modules
- .:/app
depends_on:
pnpmi:
condition: service_completed_successfully
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "ps aux | grep undexer"]
interval: 1s
timeout: 5s
retries: 5
# Local database.
# Use `just psql` to get a shell.
postgres:
network_mode: host
restart: unless-stopped
image: postgres:16.2-alpine
ports: [ "5432:5432" ]
volumes: [ "database:/var/lib/postgresql/data" ]
environment:
- POSTGRES_PASSWORD=insecure
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
# Optional DB admin.
#pgadmin:
#network_mode: host
#image: dpage/pgadmin4
#ports:
#- 5050:80
#environment:
#- PGADMIN_DEFAULT_PASSWORD=password
#- PGADMIN_LISTEN_ADDRESS=0.0.0.0
volumes:
deps:
deps-undexer:
deps-fadroma:
database: