Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
102 lines (99 loc) · 3.68 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
102 lines (99 loc) · 3.68 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
services:
# Daml Sandbox (in-memory ledger for development)
canton-sandbox:
build:
context: .
dockerfile: docker/sandbox/Dockerfile
args:
DAML_SDK_VERSION: 3.4.0-rc2
image: daml-sdk-sandbox:3.4.0-rc2
container_name: wp7-canton-sandbox
environment:
- DAML_VERSION=3.4.0-rc2
volumes:
- .:/workspace
command: >
bash -c "
cd /workspace
echo 'Testing Daml command...' &&
dpm version &&
echo 'Building Daml packages...' &&
dpm build --no-cache &&
echo 'Starting Local Ledger and Json Ledger API...' &&
dpm sandbox --ledger-api-port 6865 --json-api-port 7575 --dar .daml/dist/model-unlockit-service-test-1.0.0.dar -C canton.participants.sandbox.ledger-api.address=0.0.0.0 -C canton.participants.sandbox.http-ledger-api.server.address=0.0.0.0 --log-level-root=WARN --log-profile=container 2>&1 | tee /tmp/sandbox.log &
echo 'Waiting for Canton sandbox ready message...' &&
while [ ! -f /tmp/sandbox.log ]; do sleep 1; done &&
tail -f /tmp/sandbox.log | grep -q 'Canton sandbox is ready' &&
echo 'Canton sandbox is ready, seeding data...' &&
dpm script --dar /workspace/.daml/dist/model-unlockit-service-test-1.0.0.dar --script-name Unlockit.Test:main --ledger-host localhost --ledger-port 6865 &&
echo 'Data seeding completed!' &&
tail -f /tmp/sandbox.log
"
ports:
- "6865:6865" # Sandbox Ledger API
- "7575:7575" # JSON API
stdin_open: true
tty: true
restart: unless-stopped
healthcheck:
test: ["CMD", "sh", "-c", "timeout 5 bash -c '</dev/tcp/localhost/6865' && timeout 5 bash -c '</dev/tcp/localhost/7575' || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- wp7-sandbox-network
# Nginx CORS proxy
nginx-cors:
image: nginx:alpine
container_name: wp7-nginx-cors
ports:
- "8080:8080"
volumes:
- ./nginx-cors.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- canton-sandbox
networks:
- wp7-sandbox-network
# Backend API with Canton automation
backend:
build:
context: .
dockerfile: be/Dockerfile
args:
DAML_SDK_VERSION: 3.4.0-rc2
image: retvn-backend:latest
container_name: backend
ports:
- "9090:9090"
env_file:
- path: docker/oracle/case_1/.generated/oracle-case-1.env
required: false
environment:
- CANTON_GRPC_HOST=canton-sandbox
- CANTON_GRPC_PORT=6865
- CANTON_JSON_API_URL=http://nginx-cors:8080
- QUARKUS_HTTP_HOST=0.0.0.0
- SATP_ORACLE_EXECUTE_URL=http://host.docker.internal:4010/api/v1/@hyperledger/cactus-plugin-satp-hermes/oracle/execute
- SATP_ORACLE_CONTRACT_ARTIFACT_PATH=/app/EVM/artifacts/contracts/OracleTestContract.sol/OracleTestContract.json
- SATP_DOCUMENTS_LISTENER_ENABLED=${SATP_DOCUMENTS_LISTENER_ENABLED:-true}
- SATP_DOCUMENTS_LISTENER_STARTUP_RECONCILE_ENABLED=${SATP_DOCUMENTS_LISTENER_STARTUP_RECONCILE_ENABLED:-true}
- SATP_DOCUMENTS_LISTENER_SUBSCRIBE_ENABLED=${SATP_DOCUMENTS_LISTENER_SUBSCRIBE_ENABLED:-true}
- SATP_DOCUMENTS_LISTENER_POLL_INTERVAL_MS=${SATP_DOCUMENTS_LISTENER_POLL_INTERVAL_MS:-5000}
- CANTON_DOCUMENT_TEMPLATE_ID=${CANTON_DOCUMENT_TEMPLATE_ID:-}
volumes:
- ./EVM/artifacts:/app/EVM/artifacts:ro
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
canton-sandbox:
condition: service_healthy
nginx-cors:
condition: service_started
networks:
- wp7-sandbox-network
stdin_open: true
tty: true
networks:
wp7-sandbox-network:
driver: bridge