-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
153 lines (146 loc) · 4.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
153 lines (146 loc) · 4.34 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# =============================================================================
# Neural Memory Reproduction - Docker Compose
# Easy setup for development and testing
# =============================================================================
#
# Usage:
# Run tests: docker compose up test
# Run with coverage: docker compose up coverage
# Development: docker compose run --rm dev bash
# Jupyter notebook: docker compose up jupyter
# All services: docker compose up
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Test Runner
# Runs the full test suite with coverage
# ---------------------------------------------------------------------------
test:
build:
context: .
target: runtime
container_name: neural-memory-test
command: >
sh -c "
echo '=== Running Tests ===' &&
pytest tests/ -v --tb=short &&
echo '' &&
echo '=== All 52 tests passed! ==='
"
volumes:
# Mount source for live updates during development
- ./src:/app/src:ro
- ./tests:/app/tests:ro
environment:
- PYTHONPATH=/app
# ---------------------------------------------------------------------------
# Test with Coverage (runs as root for write permissions)
# ---------------------------------------------------------------------------
coverage:
build:
context: .
target: dev
container_name: neural-memory-coverage
user: root
command: >
sh -c "
echo '=== Running Tests with Coverage ===' &&
pytest tests/ --cov=src --cov-report=term-missing --cov-report=html &&
echo '' &&
echo '=== Coverage report generated in htmlcov/ ==='
"
volumes:
- .:/app
environment:
- PYTHONPATH=/app
working_dir: /app
# ---------------------------------------------------------------------------
# Development Environment
# Interactive shell with all development tools
# ---------------------------------------------------------------------------
dev:
build:
context: .
target: dev
container_name: neural-memory-dev
command: bash
stdin_open: true
tty: true
volumes:
# Mount everything for full development
- .:/app
# Use named volume for venv to persist installations
- venv:/app/.venv
environment:
- PYTHONPATH=/app
working_dir: /app
# ---------------------------------------------------------------------------
# Jupyter Notebook Server
# Interactive exploration and experimentation
# ---------------------------------------------------------------------------
jupyter:
build:
context: .
target: dev
container_name: neural-memory-jupyter
command: >
jupyter notebook
--ip=0.0.0.0
--port=8888
--no-browser
--allow-root
--NotebookApp.token=''
--NotebookApp.password=''
ports:
- "8888:8888"
volumes:
- .:/app
- venv:/app/.venv
environment:
- PYTHONPATH=/app
working_dir: /app
# ---------------------------------------------------------------------------
# Linting and Formatting
# Run code quality checks
# ---------------------------------------------------------------------------
lint:
build:
context: .
target: runtime
container_name: neural-memory-lint
command: >
sh -c "
echo '=== Checking Code Format ===' &&
ruff format --check src/ tests/ &&
echo '' &&
echo '=== Running Linter ===' &&
ruff check src/ tests/
"
volumes:
- ./src:/app/src:ro
- ./tests:/app/tests:ro
# ---------------------------------------------------------------------------
# Format Code
# Auto-fix formatting issues
# ---------------------------------------------------------------------------
format:
build:
context: .
target: runtime
container_name: neural-memory-format
command: >
sh -c "
echo '=== Formatting Code ===' &&
ruff format src/ tests/ &&
echo '' &&
echo '=== Fixing Lint Issues ===' &&
ruff check src/ tests/ --fix
"
volumes:
- ./src:/app/src
- ./tests:/app/tests
# Named volumes for persistence
volumes:
venv:
driver: local