-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
102 lines (96 loc) · 2.36 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
version: "3"
services:
sakura_k:
container_name: sakura_k
restart: always
ports:
- "9000:9000"
expose:
- "9000"
build:
context: ./
dockerfile: ./docker_env/sakura_k/Dockerfile
environment:
TZ: "Asia/Shanghai"
volumes:
- ../sakura_k:/app
networks:
sakura_network:
ipv4_address: "177.8.0.2"
# sakura-task:
# container_name: sakura-task
# restart: always
# build:
# context: ./
# dockerfile: ./docker_env/sakura_task/Dockerfile
# environment:
# TZ: "Asia/Shanghai"
# volumes:
# - .././sakura-task:/app
# networks:
# sakura_network:
# ipv4_address: "177.8.0.4"
sakura-redis:
container_name: sakura-redis
restart: always
image: redis:latest
ports:
- "6379:6379"
expose:
- "6379"
volumes:
- ./docker_env/redis/conf/redis.conf:/etc/redis/redis.conf
environment:
TZ: "Asia/Shanghai"
networks:
sakura_network:
ipv4_address: "177.8.0.5"
command: redis-server /etc/redis/redis.conf
sakura-mongo:
container_name: sakura-mongo
restart: always
image: mongo:latest
ports:
- "27017:27017"
# expose:
# - "27017"
volumes:
- ./docker_env/mongo/data:/data/db
- ./docker_env/mongo/log:/data/log
- ./docker_env/mongo/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js # 挂载初始化脚本
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 123456
TZ: "Asia/Shanghai" # 设置时区
networks:
sakura_network:
ipv4_address: "177.8.0.6"
command: mongod --auth --bind_ip 0.0.0.0 # 启用身份验证和允许从任何IP连接
sakura-mysql:
container_name: sakura-mysql
restart: always
image: mysql:latest
ports:
- "3306:3306"
expose:
- "3306"
volumes:
- ./docker_env/mysql/conf:/etc/mysql/conf.d
- ./docker_env/mysql/data:/var/lib/mysql
- ./docker_env/mysql/logs:/logs
environment:
TZ: "Asia/Shanghai"
MYSQL_ROOT_USERNAME: "root"
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_DATABASE: "sakura_k"
networks:
sakura_network:
ipv4_address: "177.8.0.7"
networks:
sakura_network:
driver: bridge
ipam:
driver: default
config:
- subnet: "177.8.0.0/16"
gateway: "177.8.0.1"