forked from StellarLock/StellarLock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (88 loc) · 3.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
93 lines (88 loc) · 3.03 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
# ── StellarLock — docker-compose development environment ─────────────────────
#
# Services
# ────────
# frontend Node 20 + pnpm + Vite dev server with hot-reload (port 5173)
# contracts Rust + Soroban CLI for building and testing contracts
#
# Quick start
# ───────────
# # Start the frontend dev server (Vite HMR on http://localhost:5173)
# docker-compose up frontend
#
# # Build Soroban contracts
# docker-compose run --rm contracts build
#
# # Run Rust contract tests
# docker-compose run --rm contracts test
#
# Environment
# ───────────
# Copy the testnet template before starting:
# cp .env.testnet .env
# Or pass the file explicitly:
# docker-compose --env-file .env.testnet up frontend
version: "3.9"
services:
# ── Frontend dev server ───────────────────────────────────────────────────
frontend:
build:
context: .
dockerfile: Dockerfile.dev
image: stellarlock-frontend-dev
container_name: stellarlock-frontend
ports:
- "5173:5173"
volumes:
# Mount the full source tree so Vite HMR picks up edits instantly.
- .:/app
# Use an anonymous volume for node_modules so the host directory
# (which may differ from the container's architecture) is not used.
- /app/node_modules
env_file:
# Copy .env.testnet → .env before running, or set COMPOSE_ENV_FILE.
- path: .env
required: false
- path: .env.testnet
required: false
environment:
- NODE_ENV=development
# Forward Vite host binding inside the container
- VITE_HOST=0.0.0.0
networks:
- stellarlock-net
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:5173"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# ── Contracts (Rust / Soroban CLI) ────────────────────────────────────────
contracts:
build:
context: .
dockerfile: Dockerfile.contracts
image: stellarlock-contracts
container_name: stellarlock-contracts
# Not a long-running service — invoked with `docker-compose run`.
profiles:
- contracts
volumes:
# Mount the contracts workspace for live editing.
- ./contracts:/app/contracts
# Cache the cargo registry and build artefacts across runs.
- cargo-registry:/usr/local/cargo/registry
- cargo-build:/app/contracts/target
networks:
- stellarlock-net
# Default: build contracts. Override at runtime:
# docker-compose run --rm contracts "cd contracts && cargo test"
command: ["cd contracts && stellar contract build"]
networks:
stellarlock-net:
driver: bridge
volumes:
# Persistent cargo caches dramatically speed up subsequent builds.
cargo-registry:
cargo-build: