forked from matter-labs/block-explorer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose-proxy.yaml
80 lines (74 loc) · 1.98 KB
/
compose-proxy.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
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
name: 'double-zero-proxy'
services:
app:
build:
context: .
dockerfile: ./packages/app/Dockerfile
ports:
- '3010:3010'
depends_on:
- proxy
restart: unless-stopped
proxy:
build:
context: .
dockerfile: ./packages/proxy/Dockerfile
ports:
- "4040:4040"
environment:
SERVER_PORT: 4040
BLOCK_EXPLORER_API_URL: ${BLOCK_EXPLORER_API_URL}
SESSION_SECRET: ${SESSION_SECRET}
CORS_ORIGIN: ${CORS_ORIGIN_PROXY}
RPC_URL: ${TARGET_RPC}
USER_TOKEN_URL: http://private-rpc:4041/users
CREATE_TOKEN_SECRET: ${CREATE_TOKEN_SECRET}
private-rpc-migrate:
build:
context: .
dockerfile: ./packages/private-rpc/Dockerfile
command: sh -c "yarn db:migrate"
depends_on:
db-private-rpc:
condition: service_healthy
environment:
DATABASE_URL: "postgres://postgres:postgres@db-private-rpc:5432/private-rpc"
private-rpc:
build:
context: .
dockerfile: ./packages/private-rpc/Dockerfile
volumes:
- ./compose-proxy-permissions.yaml:/app/permissions.yaml
depends_on:
db-private-rpc:
condition: service_healthy
private-rpc-migrate:
condition: service_completed_successfully
ports:
- '4041:4041'
environment:
PORT: "4041"
DATABASE_URL: "postgres://postgres:postgres@db-private-rpc:5432/private-rpc"
TARGET_RPC: ${TARGET_RPC}
PERMISSIONS_YAML_PATH: "/app/permissions.yaml"
CORS_ORIGIN: ${CORS_ORIGIN_RPC}
CREATE_TOKEN_SECRET: ${CREATE_TOKEN_SECRET}
db-private-rpc:
image: "postgres:14"
logging:
driver: none
volumes:
- db-private-rpc:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=private-rpc
volumes:
db-private-rpc: