-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
114 lines (109 loc) · 4 KB
/
docker-compose.yml
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
version: '3.9'
services:
couchbase:
image: couchbase:latest
container_name: couchbase
ports:
- "8091:8091" # Couchbase Web UI and REST API
- "8092:8092" # View API (MapReduce)
- "8093:8093" # N1QL Query Service
- "8094:8094" # Eventing Service
- "8096:8096" # Analytics Service
- "8097:8097" # Cluster Manager (Node-to-Node Communication)
- "9123:9123" # Analytics Service queries
- "11207:11207" # Smart client library communication
- "11209:11209" # Binary protocol (non-SSL)
- "11210:11210" # Data service for key-value operations
- "11211:11211" # Legacy Memcached connections
- "11280:11280" # Internal port for Full-Text Search (FTS)
- "18091:18091" # Secure Couchbase Web UI (HTTPS)
- "18092:18092" # Secure View API
- "18093:18093" # Secure N1QL Queries (SSL)
- "18094:18094" # Secure Eventing Service (SSL)
- "18096:18096" # Secure Analytics Service (SSL)
- "18097:18097" # Secure Node-to-Node Communication (TLS)
- "4369:4369" # Erlang Port Mapper (epmd)
- "21100-21299:21100-21299" # DCP, XDCR, Replication
environment:
COUCHBASE_ADMINISTRATOR_USERNAME: ${COUCHBASE_USERNAME:-Administrator}
COUCHBASE_ADMINISTRATOR_PASSWORD: ${COUCHBASE_PASSWORD:-123456}
COUCHBASE_BUCKET: ${COUCHBASE_BUCKET:-todo_list}
volumes:
- ~/couchbase/node1:/opt/couchbase/var # Persistent storage for Couchbase data and logs
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8091/ui/index.html" ] # Check if Couchbase UI is available
interval: 30s # Interval between health checks (30 seconds)
timeout: 10s # Maximum time allowed for the health check command to run (10 seconds)
retries: 5 # Number of retries before marking the service as unhealthy (5 retries)
networks:
- todowithcouchbase_network
setup-couchbase:
image: setup-couchbase:latest
container_name: setup-couchbase
build:
context: ./setup-couchbase
dockerfile: Dockerfile
depends_on:
couchbase:
condition: service_healthy
environment:
COUCHBASE_ADMINISTRATOR_USERNAME: ${COUCHBASE_USERNAME:-Administrator}
COUCHBASE_ADMINISTRATOR_PASSWORD: ${COUCHBASE_PASSWORD:-123456}
COUCHBASE_ADMIN_PORT: ${COUCHBASE_ADMIN_PORT:-8091}
COUCHBASE_N1QL_QUERY_PORT: ${COUCHBASE_N1QL_QUERY_PORT:-8093}
COUCHBASE_BUCKET: ${COUCHBASE_BUCKET:-todo_list}
COUCHBASE_HOST: couchbase
networks:
- todowithcouchbase_network
todowithcouchbase:
image: 'todowithcouchbase:latest'
build:
context: .
dockerfile: Dockerfile
container_name: todowithcouchbase
restart: on-failure
ports:
- "2323:2323"
depends_on:
couchbase:
condition: service_healthy
setup-couchbase:
condition: service_completed_successfully
env_file:
- .env # Use the .env file for environment variables
environment:
COUCHBASE_BUCKET: ${COUCHBASE_BUCKET:-todo_list}
COUCHBASE_USER: ${COUCHBASE_USERNAME:-Administrator}
COUCHBASE_PASSWORD: ${COUCHBASE_PASSWORD:-123456}
COUCHBASE_HOST: couchbase
networks:
- todowithcouchbase_network
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./data/prometheus/config:/etc/prometheus/
command:
- '--config.file=/etc/prometheus/prometheus.yml'
networks:
- todowithcouchbase_network
grafana:
image: "grafana/grafana-oss:latest"
pull_policy: always
container_name: grafana
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./data/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_SERVER_DOMAIN=localhost
networks:
- todowithcouchbase_network
networks:
todowithcouchbase_network:
driver: bridge