-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (81 loc) · 2.77 KB
/
docker-compose.yml
File metadata and controls
85 lines (81 loc) · 2.77 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
# =============================================================================
# Myanmar Spell Checker - Docker Compose Configuration
# =============================================================================
#
# Usage:
# CLI: docker compose --profile cli run --rm cli check "မြန်မာစာ"
# CLI build: docker compose --profile cli run --rm cli build --sample
# Tests: docker compose --profile test run --rm test
# Development: docker compose --profile dev up dev
# Build images: docker compose build
#
# Note: This library has no built-in web server. The API lives in the
# sarsit-webapp repo which consumes this library via FastAPI.
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# CLI Tool
# ---------------------------------------------------------------------------
cli:
build:
context: .
dockerfile: Dockerfile
target: cli
args:
PYTHON_VERSION: "3.11"
image: myspellchecker:cli
volumes:
- ./data:/app/data
- ./input:/app/input:ro
- ./output:/app/output
profiles:
- cli
# ---------------------------------------------------------------------------
# Test Runner
# ---------------------------------------------------------------------------
test:
build:
context: .
dockerfile: Dockerfile
target: development
args:
PYTHON_VERSION: "3.11"
image: myspellchecker:dev
volumes:
- ./tests:/app/tests:ro
- ./data:/app/data:ro
command: python -m pytest tests/ -v --cov=myspellchecker
profiles:
- test
# ---------------------------------------------------------------------------
# Development (mounts source for hot reload, uses pure Python fallbacks)
# ---------------------------------------------------------------------------
dev:
build:
context: .
dockerfile: Dockerfile
target: development
args:
PYTHON_VERSION: "3.11"
image: myspellchecker:dev
container_name: myspellchecker-dev
volumes:
# Mount source code for hot reload (overrides pip-installed package)
- ./src:/app/src:ro
- ./tests:/app/tests:ro
- ./data:/app/data:ro
environment:
# Intentionally set: enables hot reload of source changes at the cost
# of Cython extensions (pure Python fallbacks used instead)
- PYTHONPATH=/app/src
- LOG_LEVEL=DEBUG
- PYTHONDONTWRITEBYTECODE=1
profiles:
- dev
# =============================================================================
# Networks
# =============================================================================
networks:
default:
name: myspellchecker-network