-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (118 loc) · 3.12 KB
/
docker-compose.yml
File metadata and controls
124 lines (118 loc) · 3.12 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
version: '3.8'
services:
# ========================
# PostgreSQL 16
# ========================
postgres:
image: postgres:16-alpine
container_name: webbanthuoc_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-admin}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-admin123}
POSTGRES_DB: ${POSTGRES_DB:-webbanthuoc}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-admin} -d ${POSTGRES_DB:-webbanthuoc}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- webbanthuoc_network
# ========================
# Redis 7
# ========================
redis:
image: redis:7-alpine
container_name: webbanthuoc_redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis123}
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-redis123}", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- webbanthuoc_network
# ========================
# Elasticsearch
# ========================
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.3
container_name: webbanthuoc_elasticsearch
restart: unless-stopped
environment:
- node.name=elasticsearch
- cluster.name=webbanthuoc-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- xpack.security.enrollment.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"\\|\"status\":\"yellow\"'"]
interval: 30s
timeout: 10s
retries: 5
networks:
- webbanthuoc_network
# ========================
# MinIO S3 Self-hosted
# ========================
minio:
image: minio/minio:latest
container_name: webbanthuoc_minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin123}
ports:
- "9000:9000" # API endpoint
- "9001:9001" # Console/Web UI
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 30s
timeout: 20s
retries: 3
networks:
- webbanthuoc_network
# ========================
# Named Volumes
# ========================
volumes:
postgres_data:
driver: local
redis_data:
driver: local
elasticsearch_data:
driver: local
minio_data:
driver: local
# ========================
# Networks
# ========================
networks:
webbanthuoc_network:
driver: bridge