-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
46 lines (42 loc) · 828 Bytes
/
docker-compose.yaml
File metadata and controls
46 lines (42 loc) · 828 Bytes
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
version: '3.8'
services:
# MySQL 服务配置
mysql:
image: mysql:latest
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: your_root_password
MYSQL_DATABASE: your_database_name
volumes:
- mysql_data:/var/lib/mysql
# Redis 服务配置
redis:
image: redis:latest
restart: always
ports:
- "6379:6379"
volumes:
- redis_data:/data
# 项目服务配置
ese:
build:
context: .
ports:
- "8080:8080"
depends_on:
- mysql
- redis
environment:
MYSQL_HOST: mysql
MYSQL_PORT: "3306"
MYSQL_USER: root
MYSQL_PASSWORD: your_root_password
MYSQL_DBNAME: your_database_name
REDIS_ADDR: redis:6379
volumes:
- .:/app
volumes:
mysql_data:
redis_data: