-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (68 loc) · 1.94 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (68 loc) · 1.94 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
version: "3.8"
# Project 04 — Time Series Databases
# Silo stack — only the services this project needs.
# Three-way benchmark: Vanilla PostgreSQL vs TimescaleDB vs InfluxDB
#
# Start: docker compose up -d
# Stop: docker compose down
# Reset: docker compose down -v (destroys volumes — full clean slate)
#
# Retrieve InfluxDB token after first start:
# docker exec influxdb influx auth list --user engineer --hide-headers \
# | awk '{print $4}'
services:
# Vanilla PostgreSQL — benchmark baseline, no extensions
postgres_vanilla:
image: postgres:15
container_name: postgres_vanilla
environment:
POSTGRES_DB: sensors
POSTGRES_USER: engineer
POSTGRES_PASSWORD: engineer
ports:
- "5432:5432"
volumes:
- pg_vanilla_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U engineer -d sensors"]
interval: 5s
timeout: 3s
retries: 5
# TimescaleDB — PostgreSQL + time series extension
timescaledb:
image: timescale/timescaledb:latest-pg15
container_name: timescaledb
environment:
POSTGRES_PASSWORD: engineer
ports:
- "5433:5432"
volumes:
- timescale_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 5
# InfluxDB — purpose-built TSDB
influxdb:
image: influxdb:2.7
container_name: influxdb
ports:
- "8086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: engineer
DOCKER_INFLUXDB_INIT_PASSWORD: engineer123
DOCKER_INFLUXDB_INIT_ORG: fullstackdata
DOCKER_INFLUXDB_INIT_BUCKET: sensors
volumes:
- influx_data:/var/lib/influxdb2
healthcheck:
test: ["CMD", "influx", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
pg_vanilla_data:
timescale_data:
influx_data: