-
Notifications
You must be signed in to change notification settings - Fork 324
Expand file tree
/
Copy pathcompose.yaml
More file actions
678 lines (678 loc) · 22.7 KB
/
compose.yaml
File metadata and controls
678 lines (678 loc) · 22.7 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# This is a Docker Compose file for the InfluxData documentation site.
## Run documentation tests for code samples.
name: influxdata-docs
# Configure your credentials in the following secrets files.
secrets:
influxdb2-admin-username:
file: ~/.env.influxdb2-admin-username
influxdb2-admin-password:
file: ~/.env.influxdb2-admin-password
influxdb2-admin-token:
file: ~/.env.influxdb2-admin-token
influxdb3-core-token:
file: test/.influxdb3/core/.token
influxdb3-enterprise-admin-token:
file: ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
services:
local-dev:
build:
context: .
dockerfile_inline: |
FROM hugomods/hugo:exts-0.123.8
RUN apk add --no-cache curl openssl
command: hugo server --bind 0.0.0.0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:1313/influxdb3/cloud-dedicated/"]
interval: 1m
timeout: 10s
retries: 2
start_period: 40s
start_interval: 5s
ports:
- 1313:1313
volumes:
- type: bind
source: "$PWD"
target: /src
- type: bind
source: $HOME/hugo_cache
target: /tmp/hugo_cache
profiles:
- local
- lint
cloud-pytest:
container_name: cloud-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb/cloud/**/*.md
environment:
- CONTENT_PATH=content/influxdb/cloud
profiles:
- test
- v2
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb/cloud/.env.test
target: /app/.env.test
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: cloud-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
- type: bind
source: ./test/shared/influxdb-templates
target: /root/influxdb-templates
working_dir: /app
cloud-dedicated-pytest:
container_name: cloud-dedicated-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb3/cloud-dedicated/**/*.md
environment:
- CONTENT_PATH=content/influxdb3/cloud-dedicated
profiles:
- test
- v3
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb3/cloud-dedicated/.env.test
target: /app/.env.test
read_only: true
# The following mount assumes your influxctl configuration file is located at ./content/influxdb3/cloud-dedicated/config.toml.
- type: bind
source: ./content/influxdb3/cloud-dedicated/config.toml
target: /root/.config/influxctl/config.toml
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: cloud-dedicated-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
cloud-serverless-pytest:
container_name: cloud-serverless-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb3/cloud-serverless/**/*.md
environment:
- CONTENT_PATH=content/influxdb3/cloud-serverless
profiles:
- test
- v3
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb3/cloud-serverless/.env.test
target: /app/.env.test
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: cloud-serverless-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
clustered-pytest:
container_name: clustered-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb3/clustered/**/*.md
environment:
- CONTENT_PATH=content/influxdb3/clustered
profiles:
- test
- v3
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb3/clustered/.env.test
target: /app/.env.test
read_only: true
# The following mount assumes your influxctl configuration file is located at ./content/influxdb3/clustered/config.toml.
- type: bind
source: ./content/influxdb3/clustered/config.toml
target: /root/.config/influxctl/config.toml
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: clustered-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
influxdb3-core-pytest:
container_name: influxdb3-core-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb3/core/**/*.md
- content/shared/**/*.md
environment:
- CONTENT_PATH=content/influxdb3/core
profiles:
- test
- influxdb3
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb3/core/.env.test
target: /app/.env.test
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: influxdb3-core-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
influxdb3-enterprise-pytest:
container_name: influxdb3-enterprise-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
- content/influxdb3/enterprise/**/*.md
- content/shared/**/*.md
environment:
- CONTENT_PATH=content/influxdb3/enterprise
profiles:
- test
- influxdb3
stdin_open: true
tty: true
volumes:
- type: bind
source: .
target: /src
read_only: true
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb3/enterprise/.env.test
target: /app/.env.test
read_only: true
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
- type: volume
source: influxdb3-enterprise-tmp
target: /app/iot-starter
- type: volume
source: test-content
target: /app/content
working_dir: /app
# ============================================================================
# InfluxDB 3 Core - PER-WORKTREE INSTANCE
# ============================================================================
# Data is stored in the worktree's test/ directory for isolation.
# Token is auto-generated on first start and saved to test/.influxdb3/core/.token
#
# USAGE:
# docker compose up -d influxdb3-core
#
# AUTHENTICATION:
# Uses Docker Compose secrets for secure token management
# Token file: test/.influxdb3/core/.token (mounted as secret)
# Secret location in container: /run/secrets/influxdb3-core-token
#
# FIRST-TIME SETUP:
# Run: ./test/scripts/init-influxdb3.sh core
# This creates directories, generates token, and starts the service
#
# MANUAL SETUP (if not using init script):
# 1. Create directories: mkdir -p test/.influxdb3/core/data test/.influxdb3/core/plugins test/.influxdb3/plugins
# 2. Generate token: openssl rand -hex 32 > test/.influxdb3/core/.token
# 3. Set permissions: chmod 600 test/.influxdb3/core/.token
# 4. Start: docker compose up -d influxdb3-core
#
# CI/CD USAGE:
# Token file can be created from environment variable or secret manager
# Example: echo "$INFLUXDB3_TOKEN" > test/.influxdb3/core/.token
# ============================================================================
influxdb3-core:
container_name: influxdb3-core
image: influxdb:3-core
pull_policy: always
env_file:
- path: .env.3core
required: false
ports:
- 8282:8181
command:
- influxdb3
- serve
- --node-id=node0
- --object-store=file
- --data-dir=/var/lib/influxdb3/data
- --plugin-dir=/var/lib/influxdb3/plugins
- --admin-token-file=/run/secrets/influxdb3-core-token
- --log-filter=info
volumes:
- type: bind
source: test/.influxdb3/core/data
target: /var/lib/influxdb3/data
- type: bind
source: test/.influxdb3/plugins
target: /var/lib/influxdb3/plugins
- type: bind
source: test/.influxdb3/core/plugins
target: /var/lib/influxdb3/plugins/custom
secrets:
- influxdb3-core-token
environment:
- INFLUXDB3_PLUGIN_DIR=/var/lib/influxdb3/plugins
# ============================================================================
# InfluxDB 3 Core - NO AUTH (for endpoint testing)
# ============================================================================
# Use this service to test /ping and /health endpoints without authentication.
# Auth is disabled only for health and ping endpoints.
#
# USAGE:
# docker compose up -d influxdb3-core-noauth
# curl -i http://localhost:8283/ping # Returns version headers + JSON
# curl -i http://localhost:8283/health # Returns "OK"
#
# NOTE: HEAD requests to /ping return 404 - use GET instead.
# ============================================================================
influxdb3-core-noauth:
container_name: influxdb3-core-noauth
image: influxdb:3-core
pull_policy: always
ports:
- 8283:8181
command:
- influxdb3
- serve
- --node-id=node0
- --object-store=file
- --data-dir=/var/lib/influxdb3/data
- --disable-authz=health,ping
- --log-filter=info
volumes:
- type: bind
source: test/.influxdb3/core-noauth/data
target: /var/lib/influxdb3/data
profiles:
- noauth
# ============================================================================
# InfluxDB 3 Enterprise - SHARED INSTANCE
# ============================================================================
# This service uses a shared data directory outside the worktree to:
# - Preserve license across worktrees (trial license in data dir)
# - Allow single Enterprise instance for all docs testing
# - Avoid conflicts with users' personal ~/.influxdb3/ installs
#
# USAGE:
# docker compose --profile shared up -d influxdb3-enterprise
#
# AUTHENTICATION:
# Uses Docker Compose secrets for secure token management
# Token file: ~/influxdata-docs/.influxdb3/enterprise/admin-token.json (mounted as secret)
# Secret location in container: /run/secrets/influxdb3-enterprise-admin-token
# Format: JSON file with {"token": "...", "description": "..."}
#
# FIRST-TIME SETUP:
# 1. Create license email file: echo "INFLUXDB3_ENTERPRISE_LICENSE_EMAIL=you@example.com" > ~/influxdata-docs/.influxdb3/enterprise/.env
# 2. Run: ./test/scripts/init-influxdb3.sh enterprise
# This creates directories, generates admin-token.json, and starts the service
#
# MANUAL SETUP (if not using init script):
# 1. Create directories: mkdir -p ~/influxdata-docs/.influxdb3/enterprise/data ~/influxdata-docs/.influxdb3/plugins
# 2. Generate admin token and create JSON file:
# TOKEN=$(openssl rand -hex 32)
# echo "{\"token\": \"${TOKEN}\", \"description\": \"Admin token\"}" > ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
# chmod 600 ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
# 3. Start: docker compose --profile shared up -d influxdb3-enterprise
#
# CI/CD USAGE:
# Token file can be created from environment variable or secret manager
# Example: echo "{\"token\": \"$ADMIN_TOKEN\"}" > ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
#
# Note: License is persisted in data dir after first activation (30-day trial, renewable)
#
# The 'shared' profile prevents accidental startup from `docker compose up`.
# ============================================================================
influxdb3-enterprise:
container_name: influxdb3-enterprise
image: influxdb:3-enterprise
pull_policy: always
# License email for first-time activation (from shared .env file)
env_file:
- ~/influxdata-docs/.influxdb3/enterprise/.env
ports:
- 8181:8181
command:
- influxdb3
- serve
- --node-id=node0
- --cluster-id=cluster0
- --object-store=file
- --data-dir=/var/lib/influxdb3/data
- --plugin-dir=/var/lib/influxdb3/plugins
- --admin-token-file=/run/secrets/influxdb3-enterprise-admin-token
- --license-type=trial
- --log-filter=info
environment:
- INFLUXDB3_PLUGIN_DIR=/var/lib/influxdb3/plugins
volumes:
# Shared data directory - persists license and data across worktrees
- type: bind
source: ~/influxdata-docs/.influxdb3/enterprise/data
target: /var/lib/influxdb3/data
- type: bind
source: ~/influxdata-docs/.influxdb3/plugins
target: /var/lib/influxdb3/plugins
secrets:
- influxdb3-enterprise-admin-token
profiles:
- shared
influxdb3-explorer:
container_name: influxdb3-explorer
image: influxdata/influxdb3-ui:latest
pull_policy: always
ports:
- 8888:80
- 8889:8888
command:
- --mode=admin
profiles:
- explorer
- influxdb3
telegraf-pytest:
container_name: telegraf-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/telegraf/**/*.md
environment:
- CONTENT_PATH=content/telegraf
profiles:
- test
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/telegraf/.env.test
target: /app/.env.test
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: telegraf-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
v2-pytest:
container_name: v2-pytest
image: influxdata/docs-pytest
build:
context: .
dockerfile: Dockerfile.pytest
entrypoint:
- /bin/bash
- /src/test/scripts/run-tests.sh
- pytest
command:
# In the command, pass file paths to test.
# The container preprocesses the files for testing and runs the tests.
- content/influxdb/v2/**/*.md
environment:
- CONTENT_PATH=content/influxdb/v2
profiles:
- test
- v2
stdin_open: true
tty: true
volumes:
# Site configuration files.
- type: bind
source: .
target: /src
read_only: true
# Files shared between host and container and writeable by both.
- type: bind
source: ./test/shared
target: /shared
- type: bind
source: ./content/influxdb/v2/.env.test
target: /app/.env.test
read_only: true
# In your code samples, use `/app/data/<FILE.lp>` or `data/<FILE.lp>` to access sample data files from the `static/downloads` directory.
- type: bind
source: ./static/downloads
target: /app/data
read_only: true
# In your code samples, use `/app/iot-starter` to store example modules or project files.
- type: volume
source: v2-tmp
target: /app/iot-starter
# Target directory for the content under test.
# Files are copied from /src/content/<productpath> to /app/content/<productpath> before running tests.
- type: volume
source: test-content
target: /app/content
working_dir: /app
influxdb2:
container_name: influxdb2
image: influxdb:2
ports:
- 8086:8086
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME_FILE: /run/secrets/influxdb2-admin-username
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE: /run/secrets/influxdb2-admin-token
DOCKER_INFLUXDB_INIT_ORG: docs
DOCKER_INFLUXDB_INIT_BUCKET: get-started
INFLUX_ORG: docs
INFLUX_BUCKET: get-started
profiles:
- v2
- local
secrets:
- influxdb2-admin-username
- influxdb2-admin-password
- influxdb2-admin-token
volumes:
- type: volume
source: influxdb2-data
target: /var/lib/influxdb2
- type: volume
source: influxdb2-config
target: /etc/influxdb2
remark-lint:
container_name: remark-lint
build:
context: .
dockerfile: .ci/Dockerfile.remark
profiles:
- lint
volumes:
# Mount repository to /workdir to avoid overwriting /app/ node_modules
# Remark will receive paths like /workdir/content/file.md or /workdir/README.md
# Writable mount allows auto-fixing instruction files (README.md, DOCS-*.md, etc.)
- type: bind
source: .
target: /workdir
read_only: false
volumes:
test-content:
influxdb3-core-tmp:
influxdb3-enterprise-tmp:
cloud-tmp:
cloud-dedicated-tmp:
cloud-serverless-tmp:
clustered-tmp:
telegraf-tmp:
v2-tmp: