-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
200 lines (191 loc) · 6.33 KB
/
docker-compose.yml
File metadata and controls
200 lines (191 loc) · 6.33 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# =============================================================================
# Docker Compose for ad-blocking toolkit development
# =============================================================================
services:
# ---------------------------------------------------------------------------
# Main development environment with all tools
# ---------------------------------------------------------------------------
dev:
build:
context: .
dockerfile: Dockerfile.warp
args:
DENO_VERSION: 2.x
RUST_VERSION: stable
image: ad-blocking-dev:latest
container_name: ad-blocking-dev
volumes:
- .:/workspace
# Named volumes for dependency caching
- deno_cache:/root/.deno
- cargo_registry:/root/.cargo/registry
- cargo_git:/root/.cargo/git
- nuget_packages:/root/.nuget/packages
environment:
- DEBUG=${DEBUG:-}
- AdGuard__ApiKey=${ADGUARD_API_KEY:-}
- DOTNET_CLI_TELEMETRY_OPTOUT=1
working_dir: /workspace
stdin_open: true
tty: true
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# TypeScript Rules Compiler service
# ---------------------------------------------------------------------------
typescript-compiler:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-typescript
volumes:
- .:/workspace
- deno_cache:/root/.deno
working_dir: /workspace/src/rules-compiler-typescript
command: deno task compile
depends_on:
- dev
profiles:
- compile
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# .NET Rules Compiler service
# ---------------------------------------------------------------------------
dotnet-compiler:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-dotnet
volumes:
- .:/workspace
- nuget_packages:/root/.nuget/packages
working_dir: /workspace/src/rules-compiler-dotnet
command: dotnet run --project src/RulesCompiler.Console
depends_on:
- dev
profiles:
- compile
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# Python Rules Compiler service
# ---------------------------------------------------------------------------
python-compiler:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-python
volumes:
- .:/workspace
working_dir: /workspace/src/rules-compiler-python
command: python -m rules_compiler
depends_on:
- dev
profiles:
- compile
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# Rust Rules Compiler service
# ---------------------------------------------------------------------------
rust-compiler:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-rust
volumes:
- .:/workspace
- cargo_registry:/root/.cargo/registry
- cargo_git:/root/.cargo/git
working_dir: /workspace/src/rules-compiler-rust
command: cargo run --release
depends_on:
- dev
profiles:
- compile
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# Test runner service (runs all tests)
# ---------------------------------------------------------------------------
test:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-test
volumes:
- .:/workspace
- deno_cache:/root/.deno
- nuget_packages:/root/.nuget/packages
- cargo_registry:/root/.cargo/registry
- cargo_git:/root/.cargo/git
working_dir: /workspace
command: >
bash -c "
echo '=== Running TypeScript Tests ===' &&
cd /workspace/src/rules-compiler-typescript && deno task test &&
echo '=== Running .NET Tests ===' &&
cd /workspace/src/rules-compiler-dotnet && dotnet test RulesCompiler.slnx &&
echo '=== Running Python Tests ===' &&
cd /workspace/src/rules-compiler-python && pytest &&
echo '=== Running Rust Tests ===' &&
cd /workspace/src/rules-compiler-rust && cargo test &&
echo '=== Running PowerShell Tests ===' &&
pwsh -Command 'Invoke-Pester -Path /workspace/src/adguard-api-powershell/Tests/ -PassThru' &&
echo '=== All Tests Complete ==='
"
depends_on:
- dev
profiles:
- test
networks:
- ad-blocking-net
# ---------------------------------------------------------------------------
# AdGuard Console UI
# ---------------------------------------------------------------------------
console-ui:
build:
context: .
dockerfile: Dockerfile.warp
image: ad-blocking-dev:latest
container_name: ad-blocking-console
volumes:
- .:/workspace
- nuget_packages:/root/.nuget/packages
environment:
- AdGuard__ApiKey=${ADGUARD_API_KEY:-}
working_dir: /workspace/src/adguard-api-dotnet
command: dotnet run --project src/AdGuard.ConsoleUI
stdin_open: true
tty: true
depends_on:
- dev
profiles:
- console
networks:
- ad-blocking-net
# =============================================================================
# Named volumes for dependency caching
# =============================================================================
volumes:
deno_cache:
name: ad-blocking-deno-cache
cargo_registry:
name: ad-blocking-cargo-registry
cargo_git:
name: ad-blocking-cargo-git
nuget_packages:
name: ad-blocking-nuget
# =============================================================================
# Networks
# =============================================================================
networks:
ad-blocking-net:
name: ad-blocking-network
driver: bridge