-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (90 loc) · 2.91 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (90 loc) · 2.91 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
services:
mysql:
image: mysql:9.1
container_name: ulticode-mysql
# Bind to all interfaces so IPv4 port-mapped connections (localhost:23306) reach the
# MySQL handshake. Without this, MySQL 9.1 listens on IPv6 [::]:3306 only, and Docker
# Desktop on WSL2 fails to forward the IPv4→IPv6 handshake to the container.
command: ["--bind-address=0.0.0.0"]
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:?MYSQL_ROOT_PASSWORD is required}
MYSQL_DATABASE: ${DB_NAME:-ulticode}
MYSQL_USER: ${DB_USER:-ulticode}
MYSQL_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
MYSQL_CHARACTER_SET_SERVER: utf8mb4
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
volumes:
- mysql_data:/var/lib/mysql
- ./docker/initdb:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
infrastructure:
ipv4_address: 172.18.0.2
redis:
image: redis:7-alpine
container_name: ulticode-redis
expose:
- "6379"
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD:?REDIS_PASSWORD is required}"]
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "sh", "-c", "REDISCLI_AUTH=$$REDIS_PASSWORD redis-cli ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
infrastructure:
ipv4_address: 172.18.0.3
nacos:
image: nacos/nacos-server:v2.3.2
container_name: ulticode-nacos
expose:
- "8848"
- "9848"
environment:
MODE: standalone
SPRING_DATASOURCE_PLATFORM: mysql
MYSQL_SERVICE_HOST: mysql
MYSQL_SERVICE_PORT: 3306
MYSQL_SERVICE_DB_NAME: nacos_config
MYSQL_SERVICE_USER: root
MYSQL_SERVICE_PASSWORD: ${MYSQL_ROOT_PASSWORD:?MYSQL_ROOT_PASSWORD is required}
MYSQL_SERVICE_DB_PARAM: "characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true"
JVM_XMS: 256m
JVM_XMX: 512m
NACOS_AUTH_ENABLE: "true"
NACOS_AUTH_TOKEN: ${NACOS_AUTH_TOKEN:?NACOS_AUTH_TOKEN is required}
NACOS_AUTH_IDENTITY_KEY: ${NACOS_AUTH_IDENTITY_KEY:?NACOS_AUTH_IDENTITY_KEY is required}
NACOS_AUTH_IDENTITY_VALUE: ${NACOS_AUTH_IDENTITY_VALUE:?NACOS_AUTH_IDENTITY_VALUE is required}
volumes:
- nacos_logs:/home/nacos/logs
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/"]
interval: 10s
timeout: 5s
retries: 10
networks:
infrastructure:
ipv4_address: 172.18.0.4
networks:
infrastructure:
internal: true
ipam:
config:
- subnet: 172.18.0.0/24
volumes:
mysql_data:
redis_data:
nacos_logs: