Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
136 lines (130 loc) · 4.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
136 lines (130 loc) · 4.08 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
# Docker Compose for ElasticScope
# Development and Production configurations
services:
# ============================================
# ElasticScope Application
# ============================================
elasticscope:
build:
context: .
dockerfile: Dockerfile
container_name: elasticscope
ports:
- "3001:3001"
volumes:
- elasticscope-data:/app/data
environment:
- NODE_ENV=production
- PORT=3001
# ========== Database Configuration ==========
# Database type: sqlite (default) | postgresql | mysql
- DB_TYPE=${DB_TYPE:-sqlite}
# Password encryption key (REQUIRED in production!)
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-elasticscope-default-key-change-me!}
# ---------- SQLite (default) ----------
# Path to SQLite database file
- DB_PATH=${DB_PATH:-/app/data/connections.db}
# ---------- PostgreSQL ----------
# Uncomment these when using DB_TYPE=postgresql
# - DB_HOST=${DB_HOST:-localhost}
# - DB_PORT=${DB_PORT:-5432}
# - DB_NAME=${DB_NAME:-elasticscope}
# - DB_USER=${DB_USER:-postgres}
# - DB_PASSWORD=${DB_PASSWORD:-}
# - DB_SSL=${DB_SSL:-false}
# - DB_POOL_SIZE=${DB_POOL_SIZE:-10}
# ---------- MySQL ----------
# Uncomment these when using DB_TYPE=mysql
# - DB_HOST=${DB_HOST:-localhost}
# - DB_PORT=${DB_PORT:-3306}
# - DB_NAME=${DB_NAME:-elasticscope}
# - DB_USER=${DB_USER:-root}
# - DB_PASSWORD=${DB_PASSWORD:-}
# - DB_SSL=${DB_SSL:-false}
# - DB_POOL_SIZE=${DB_POOL_SIZE:-10}
restart: unless-stopped
networks:
- elasticscope-network
# ============================================
# ElasticScope Development Mode
# ============================================
elasticscope-dev:
build:
context: .
dockerfile: Dockerfile.dev
container_name: elasticscope-dev
ports:
- "3001:3001" # Next.js app and API
volumes:
- .:/app
- /app/node_modules
- elasticscope-data:/app/data
environment:
- NODE_ENV=development
- PORT=3001
# ========== Database Configuration ==========
- DB_TYPE=${DB_TYPE:-sqlite}
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-elasticscope-default-key-change-me!}
- DB_PATH=${DB_PATH:-/app/data/connections.db}
# Uncomment for PostgreSQL/MySQL (see production config above)
# - DB_HOST=${DB_HOST:-localhost}
# - DB_PORT=${DB_PORT:-5432}
# - DB_NAME=${DB_NAME:-elasticscope}
# - DB_USER=${DB_USER:-postgres}
# - DB_PASSWORD=${DB_PASSWORD:-}
# - DB_SSL=${DB_SSL:-false}
# - DB_POOL_SIZE=${DB_POOL_SIZE:-10}
profiles:
- dev
networks:
- elasticscope-network
# ============================================
# Optional: Local Elasticsearch for testing
# ============================================
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: elasticscope-es
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- "9200:9200"
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
profiles:
- with-es
networks:
- elasticscope-network
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q 'green\\|yellow'"]
interval: 30s
timeout: 10s
retries: 5
# ============================================
# Elasticsearch Seed Data Loader
# Loads sample data when Elasticsearch starts
# ============================================
elasticsearch-seed:
build:
context: .
dockerfile: Dockerfile.seed
container_name: elasticscope-es-seed
environment:
- ES_HOST=http://elasticsearch:9200
depends_on:
elasticsearch:
condition: service_healthy
profiles:
- with-es
networks:
- elasticscope-network
restart: "no"
volumes:
elasticscope-data:
driver: local
elasticsearch-data:
driver: local
networks:
elasticscope-network:
driver: bridge