Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (77 loc) · 2.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (77 loc) · 2.84 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
# =============================================================================
# GIK CLI - Docker Compose Configuration
# =============================================================================
#
# This file defines services for development and building GIK CLI.
#
# SERVICES:
# gik-dev - Development environment with full toolchain
# gik-build - Build-only service for release compilation
#
# VOLUMES:
# cargo-cache - Shared cargo registry cache (speeds up builds)
# target-cache - Shared build artifacts (speeds up incremental builds)
#
# USAGE:
# docker-compose run --rm gik-dev bash # Development shell
# docker-compose run --rm gik-dev cargo test # Run tests
# docker-compose run --rm gik-dev cargo build # Dev build
# docker-compose build gik-dev # Rebuild dev image
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Development Environment
# ---------------------------------------------------------------------------
# Full development environment with all tools for building, testing, and
# debugging. Uses volume mounts for:
# - Source code (live editing)
# - Cargo registry (shared cache)
# - Target directory (incremental builds)
gik-dev:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
# Mount source code for live editing
- .:/workspace
# Persistent cargo registry cache
- cargo-cache:/usr/local/cargo/registry
# Persistent target cache for incremental builds
- target-cache:/workspace/target
working_dir: /workspace
stdin_open: true
tty: true
environment:
# Enable backtraces for debugging
- RUST_BACKTRACE=1
# Colored output
- CARGO_TERM_COLOR=always
# Faster incremental builds
- CARGO_INCREMENTAL=1
# ---------------------------------------------------------------------------
# Build Service
# ---------------------------------------------------------------------------
# Standalone build service for release compilation.
# Uses the production Dockerfile for consistent builds.
gik-build:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/workspace
working_dir: /workspace
# =============================================================================
# Shared Volumes
# =============================================================================
# These volumes persist across container restarts, significantly speeding up
# subsequent builds by caching:
# - Downloaded crates from crates.io
# - Compiled dependencies
volumes:
# Cargo registry cache (~2GB for full dependencies)
cargo-cache:
name: gik-cargo-cache
# Build target cache (~5GB for full debug + release builds)
target-cache:
name: gik-target-cache