docker-compose keycloak安装
FCAT 2020/8/12 keycloakdocker-compose
构建环境:docker、docker-compose、mysql(导入keycloak数据)
# 配置文件
vim /docker/docker-compose.yml
version: "3.9"
services:
mysql:
image: mysql:5.6.50
container_name: mysql
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
restart: always
volumes:
- /etc/localtime:/etc/localtime
- /docker/mysql/conf:/etc/mysql/conf.d
- /docker/mysql/data:/var/lib/mysql
- /docker/mysql/log:/var/log
keycloak:
image: jboss/keycloak:4.8.3.Final
container_name: keycloak
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=123456
- DB_VENDOR=MYSQL
- DB_ADDR=mysql
- DB_DATABASE=keycloak
- DB_USER=root
- DB_PASSWORD=123456
- PROXY_ADDRESS_FORWARDING=true
ports:
- 8080:8080
- 9443:9443
- 10990:10990
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
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
纯净版本安装会遇到问题 报错 Keycloak Docker HTTPS required 进入容器内:
cd keycloak/bin/
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
Logging into http://localhost:8080/auth as user admin of realm master
Enter password: admin
./kcadm.sh update realms/master -s sslRequired=NONE
1
2
3
4
5
2
3
4
5
# 运行
运行:docker-compose up -d
1