-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (125 loc) · 4.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
126 lines (125 loc) · 4.41 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
services:
postgres:
image: postgres:16-alpine
ports:
# Host port is overridable to avoid clashing with a local Postgres.
- "${POSTGRES_PORT:-5433}:5432"
volumes:
- miden-source-code-verification-postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=miden-source-code-verification
- POSTGRES_PASSWORD=miden_source_code_verification_dev_password
- POSTGRES_DB=miden-source-code-verification
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U miden-source-code-verification -d miden-source-code-verification",
]
interval: 5s
timeout: 5s
retries: 5
api-compile:
build:
# Build context is the monorepo root so pnpm can resolve the workspace.
context: .
dockerfile: apps/api-compile/Dockerfile
# Self-contained dev config (no .env file needed). CARGO_TARGET_DIR /
# MIDEN_CLIENT_CACHE_DIR must match the warm cache paths baked into the image.
environment:
- PORT=8080
- ALLOWED_ORIGINS=*
- CARGO_TARGET_DIR=/cache/target
- MIDEN_CLIENT_CACHE_DIR=/cache
image: miden-source-code-verification-api-compile
container_name: miden-source-code-verification-api-compile
ports:
- "8080:8080"
healthcheck:
# Health check via Node's global fetch (no extra tooling required).
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:8080/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
api-registry-migrate:
build:
# Build context is the monorepo root so pnpm can resolve the workspace.
context: .
dockerfile: apps/api-registry/Dockerfile
target: migrate
environment:
# In-network address of the compose postgres service.
- DATABASE_URL=postgresql://miden-source-code-verification:miden_source_code_verification_dev_password@postgres:5432/miden-source-code-verification
image: miden-source-code-verification-api-registry-migrate
container_name: miden-source-code-verification-api-registry-migrate
depends_on:
postgres:
condition: service_healthy
restart: "no"
api-registry:
build:
# Build context is the monorepo root so pnpm can resolve the workspace.
context: .
dockerfile: apps/api-registry/Dockerfile
# Self-contained dev config (no .env file needed); uses in-network service addresses.
environment:
- PORT=8081
- ALLOWED_ORIGINS=*
- DATABASE_URL=postgresql://miden-source-code-verification:miden_source_code_verification_dev_password@postgres:5432/miden-source-code-verification
- API_COMPILE_URL=http://api-compile:8080
image: miden-source-code-verification-api-registry
container_name: miden-source-code-verification-api-registry
depends_on:
postgres:
condition: service_healthy
api-registry-migrate:
condition: service_completed_successfully
api-compile:
condition: service_healthy
ports:
- "8081:8081"
healthcheck:
# node:slim has no curl; use Node's global fetch instead.
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:8081/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
web-verifier:
build:
# Build context is the monorepo root so pnpm can resolve the workspace.
context: .
dockerfile: apps/web-verifier/Dockerfile
image: miden-source-code-verification-web-verifier
container_name: miden-source-code-verification-web-verifier
depends_on:
api-registry:
condition: service_healthy
ports:
# Host 5173 -> nginx :80. The SPA is served here and (per the baked-in
# default) calls api-registry at the host-published http://localhost:8081.
- "5173:80"
healthcheck:
# nginx:alpine ships busybox wget (no curl); probe the served index. Use
# 127.0.0.1 (not localhost) — in-container `localhost` resolves to ::1,
# but nginx `listen 80;` binds IPv4 only, so localhost would be refused.
test: ["CMD-SHELL", "wget -qO /dev/null http://127.0.0.1/ || exit 1"]
interval: 5s
timeout: 3s
retries: 30
start_period: 5s
volumes:
miden-source-code-verification-postgres: