Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (107 loc) · 4.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
111 lines (107 loc) · 4.38 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
services:
# Stellar Quickstart: Provides local Stellar testnet with Soroban RPC support
stellar:
image: ${STELLAR_QUICKSTART_IMAGE:-stellar/quickstart:soroban-dev}
container_name: ${STELLAR_CONTAINER_NAME:-stellarwork-stellar}
platform: linux/amd64
ports:
# Horizon API (legacy REST API)
- "${STELLAR_HORIZON_PORT:-8000}:8000"
# Soroban RPC
- "${STELLAR_RPC_PORT:-8000}:8000"
environment:
- LOG_LEVEL=${STELLAR_LOG_LEVEL:-info}
volumes:
# Named volume for persisting testnet state across restarts
- stellar-data:/opt/stellar
# Start with testnet mode - you can change --local to --testnet or --futurenet as needed
command: >
${STELLAR_NETWORK_FLAG:---local}
--enable-soroban-rpc
--enable-soroban-diagnostic-events
# Health check ensures dependent services wait for Stellar RPC to be ready
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 20s
networks:
- stellarwork-network
# Frontend: Next.js development server with hot reload
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: deps
container_name: ${FRONTEND_CONTAINER_NAME:-stellarwork-frontend}
working_dir: /app
ports:
- "${FRONTEND_PORT:-3000}:3000"
volumes:
# Mount source directory for hot reload
- ./frontend:/app
# Exclude node_modules from host mount to avoid shadowing container-installed deps
- /app/node_modules
# Exclude .next from host mount to avoid cache conflicts
- /app/.next
environment:
# Development settings
- NODE_ENV=development
- WATCHPACK_POLLING=${WATCHPACK_POLLING:-true}
- CHOKIDAR_USEPOLLING=${CHOKIDAR_USEPOLLING:-true}
# Frontend will connect to Stellar via Docker service name on compose network
- NEXT_PUBLIC_SOROBAN_RPC=${NEXT_PUBLIC_SOROBAN_RPC:-http://stellar:8000}
- NEXT_PUBLIC_NETWORK=${NEXT_PUBLIC_NETWORK:-standalone}
# Pass through any other NEXT_PUBLIC_ environment variables from .env.local
- NEXT_PUBLIC_CONTRACT_ID=${NEXT_PUBLIC_CONTRACT_ID:-}
- NEXT_PUBLIC_NETWORK_PASSPHRASE=${NEXT_PUBLIC_NETWORK_PASSPHRASE:-Standalone Network ; February 2017}
- NEXT_PUBLIC_ADMIN_ADDRESS=${NEXT_PUBLIC_ADMIN_ADDRESS:-}
command: npm run dev
# Wait for Stellar to be healthy before starting frontend
depends_on:
stellar:
condition: service_healthy
networks:
- stellarwork-network
# Contract Builder: Rust/Soroban build environment
# This service provides the build toolchain for compiling Soroban contracts to WebAssembly
contract-builder:
image: ${RUST_IMAGE:-rust:latest}
container_name: ${CONTRACT_BUILDER_CONTAINER_NAME:-stellarwork-contract-builder}
working_dir: /workspace
volumes:
# Mount contracts directory for building
- ./contracts:/workspace/contracts
# Use named volume for Cargo registry cache to speed up builds
- cargo-cache:/usr/local/cargo/registry
# Cache compiled artifacts across builds
- cargo-build-cache:/workspace/contracts/escrow/target
environment:
- CARGO_NET_GIT_FETCH_WITH_CLI=${CARGO_NET_GIT_FETCH_WITH_CLI:-true}
- RUST_BACKTRACE=${RUST_BACKTRACE:-1}
# Start a dummy process to keep container alive; users run builds via docker compose exec
# To build: docker compose exec contract-builder bash -c "cd contracts/escrow && cargo build --target wasm32-unknown-unknown"
# Or: docker compose exec contract-builder bash -c "cd contracts/escrow && soroban contract build"
command: tail -f /dev/null
networks:
- stellarwork-network
profiles:
# Use 'profiles: [builder]' to make this an optional service
# Run with: docker compose --profile builder up
# Or run builds ad-hoc: docker compose exec contract-builder <command>
- builder
networks:
stellarwork-network:
driver: bridge
name: ${COMPOSE_NETWORK_NAME:-stellarwork-network}
volumes:
# Stellar testnet state persistence
stellar-data:
name: ${STELLAR_VOLUME_NAME:-stellarwork-stellar-data}
# Cargo registry cache for dependency downloads
cargo-cache:
name: ${CARGO_CACHE_VOLUME_NAME:-stellarwork-cargo-cache}
# Cargo build artifacts cache
cargo-build-cache:
name: ${CARGO_BUILD_CACHE_VOLUME_NAME:-stellarwork-cargo-build-cache}