dromara / MaxKey

🗝️MaxKey SSO ,Leading-Edge IAM-IDaas(Identity and Access Management) Product,业界领先的IAM-IDaas身份管理和认证产品,支持OAuth2.x、OpenID Connect、SAML2.0、JWT、CAS、SCIM等SSO标准协议,基于RBAC统一权限控制,实现用户生命周期管理,开源、安全、合规、自主可控。
https://www.maxkey.top
Apache License 2.0
1.51k stars 331 forks source link

请问docker部署后如何使用 #226

Closed n3A87 closed 2 weeks ago

n3A87 commented 6 months ago

我已按照这个文档,在本地docker上部署完成,接下来该如何做呢?

我点击http://sso.maxkey.top/maxkey/后,出现这样的报错提示,请问是什么原因?

1

n3A87 commented 6 months ago

本地docker容器: image

shimingxy commented 6 months ago

请提供docker日志的错误日志

n3A87 commented 6 months ago

请提供docker日志的错误日志

请问需要查看哪个容器的日志? image

maxKey日志如下: 1

猜测是没连接上mysql,我应该在哪个地方配置?

ArronYR commented 2 months ago

按照官方文档进行 docker-compose 部署时,仓库中的yml文件内容配置有误,需要修改docker-compose.yml文件内容如下:

version: '3'

networks:
  maxkey.top:
    driver: bridge

services:
  mysql:
    image: mysql:8.0.32
    container_name: maxkey-mysql
    hostname: maxkey-mysql
    volumes:
      - ./docker-mysql/data:/var/lib/mysql
      - ./docker-mysql/logs:/var/log/mysql
      - ./docker-mysql/conf.d:/etc/mysql/conf.d
      - ./docker-mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    environment:
      - MYSQL_ROOT_PASSWORD=maxkey
    ports:
      - "3306:3306"
    restart: always
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    networks:
      - maxkey.top

  maxkey-frontend:
    image: maxkeytop/maxkey-frontend:latest
    container_name: maxkey-frontend
    hostname: maxkey-frontend
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "8527:8527"
    networks:
      - maxkey.top

  maxkey:
    image: maxkeytop/maxkey:latest
    container_name: maxkey
    hostname: maxkey
    environment:
      - DATABASE_HOST=maxkey-mysql
      - DATABASE_PORT=3306
      - DATABASE_NAME=maxkey
      - DATABASE_USER=root
      - DATABASE_PWD=maxkey
    ports:
      - "9527:9527"
    networks:
      - maxkey.top
    depends_on:
      - mysql

  maxkey-mgt:
    image: maxkeytop/maxkey-mgt:latest
    container_name: maxkey-mgt
    hostname: maxkey-mgt
    environment:
      - DATABASE_HOST=maxkey-mysql
      - DATABASE_PORT=3306
      - DATABASE_NAME=maxkey
      - DATABASE_USER=root
      - DATABASE_PWD=maxkey
    ports:
      - "9526:9526"
    networks:
      - maxkey.top
    depends_on:
      - mysql

  maxkey-mgt-frontend:
    image: maxkeytop/maxkey-mgt-frontend:latest
    container_name: maxkey-mgt-frontend
    hostname: maxkey-mgt-frontend
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "8526:8526"
    networks:
      - maxkey.top

  maxkey-nginx:
    image: nginx:latest
    container_name: maxkey-nginx
    hostname: maxkey-nginx
    volumes:
      - ./docker-nginx:/etc/nginx/conf.d
    ports:
      - "8012:80"
    networks:
      - maxkey.top
    depends_on:
      - maxkey-frontend
      - maxkey-mgt-frontend
      - maxkey
      - maxkey-mgt

增加对应的 depends_on 配置,然后访问:

http://localhost:8012/maxkey-mgt/
http://localhost:8012/maxkey/
ArronYR commented 2 months ago

请提供docker日志的错误日志

请问需要查看哪个容器的日志? image

maxKey日志如下: 1

猜测是没连接上mysql,我应该在哪个地方配置?

我刚开始也遇到了这个问题,后来自己摸索出来发现是仓库中的yml配置有点问题,在自己本地docker环境hostname并未生效,按照上面我发的配置修改后就可以了。

shimingxy commented 2 weeks ago

请加官方qq协助解决,发issue编号