Gravitee.io 官方提供的docker-compose 快速运行的方式

默认ui 账户 admin adminadmin

环境准备

  • docker-compose 文件
#
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version: '2'
volumes:
  datamongo: {}
services:
  nginx:
    image: nginx:1.15-alpine
    container_name: gio_am_nginx
    restart: always
    volumes:
      - ./config/nginx.conf:/etc/nginx/nginx.conf
    ports:
      - ${NGINX_PORT}:80
    depends_on:
      - management
      - gateway
      - webui
  mongodb:
    image: mongo:3.4
    container_name: gio_am_mongodb
    restart: always
    volumes:
      - datamongo:/data/db
      - ./logs/am-mongodb:/var/log/mongodb
  gateway:
    image: graviteeio/am-gateway:${GIO_AM_VERSION}
    container_name: gio_am_gateway
    restart: always
    links:
      - mongodb
    depends_on:
      - mongodb
    volumes:
      - ./logs/am-gateway:/etc/gravitee.io/log
    environment:
      - gravitee_management_mongodb_uri=mongodb://mongodb:27017/graviteeam?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
      - gravitee_oauth2_mongodb_uri=mongodb://mongodb:27017/graviteeam?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
  management:
    image: graviteeio/am-management-api:${GIO_AM_VERSION}
    container_name: gio_am_management
    restart: always
    links:
      - mongodb
    depends_on:
      - mongodb
    volumes:
      - ./logs/am-management-api:/etc/gravitee.io/log
    environment:
      - gravitee_management_mongodb_uri=mongodb://mongodb:27017/graviteeam?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
      - gravitee_oauth2_mongodb_uri=mongodb://mongodb:27017/graviteeam?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
  webui:
    image: graviteeio/am-management-ui:${GIO_AM_VERSION}
    container_name: gio_am_webui
    restart: always
    depends_on:
      - management
    environment:
      - MGMT_API_URL=http://localhost:${NGINX_PORT}/am/
      - MGMT_UI_URL=http://localhost:${NGINX_PORT}/am/ui/
    volumes:
      - ./logs/am-webui:/var/log/httpd
 
 
  • env 文件(系统运行的变量配置)
GIO_AM_VERSION=2
NGINX_PORT=80
  • nginx.conf ( nginx proxy 的配置)
worker_processes 4;
events { worker_connections 1024; }
http {
        include /etc/nginx/mime.types;
        resolver 127.0.0.11 ipv6=off;
        upstream management {
            server management:8093;
        }
        upstream gateway {
            server gateway:8092;
        }
        upstream webui {
            server webui:80;
        }
        server {
            listen 80;
              location /am/ui/ {
                    proxy_pass http://webui/;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-Forwarded-Host $server_name;
                    sub_filter '<base href="/"' '<base href="/am/ui/"';
                    sub_filter_once on;
              }
              location /am/management/ {
                    proxy_pass http://management/management/;
                    proxy_redirect http://$host:$server_port/am/ui/ /am/ui/;
                    proxy_redirect http://$host:$server_port/management/ /am/management/;
                    proxy_cookie_path /management /am/management;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-Forwarded-Host $server_name;
              }
              location /am/admin/ {
                    proxy_pass http://management/admin/;
                    proxy_redirect http://$http_host/admin/ http://$http_host/am/admin/;
                    proxy_cookie_path /admin /am/admin;
                    proxy_set_header Host $http_host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-Forwarded-Host $server_name;
              }
              location /am/ {
                    proxy_pass http://gateway/;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-Forwarded-Host $server_name;
                    proxy_set_header X-Forwarded-Prefix /am;
              }
              error_page 500 502 503 504 /50x.html;
              location = /50x.html {
                    root /usr/share/nginx/html;
              }
        }
}
 
 
  • 代码结构

运行&&效果

  • 运行
 
docker-compose up -d 

参考资料

https://docs.gravitee.io/am/2.x/am_installguide_docker.html

Gravitee.io Access Management docker-compose运行的更多相关文章

  1. Gravitee.io Access Management 组件

    Access Management组件在Gravitee.io 主要是进行认证以及权鉴的处理,支持oauth2 以及openid connect 等协议,同时好多功能已经集成在ui 管理界面上了,还是 ...

  2. dotnet跨平台 - 使用Nginx+Docker Compose运行.NETCore项目

    参考文档: https://docs.docker.com/install/linux/docker-ce/centos/ http://www.dockerinfo.net/document htt ...

  3. .NET遇上Docker - 使用Docker Compose组织Ngnix和.NETCore运行

    本文工具准备: Docker for Windows Visual Studio 2015 与 Visual Studio Tools for Docker 或 Visual Studio 2017 ...

  4. 使用 pycharm调试docker环境运行的Odoo

    2019日 星期一 安装docker windows系统,参考 docker官方文档 Mac系统,参考 docker官方文档 构建自定义ODOO镜像 标准ODOO镜像可能不包含特别的python模块, ...

  5. Docker:Docker Compose 详解

    Docker Compose 概述与安装? 前面我们使用 Docker 的时候,定义 Dockerfile 文件,然后使用 docker build.docker run 等命令操作容器.然而微服务架 ...

  6. Gravitee.io docker-compose运行

    Gravitee.io 是一个相对比较完整的api gateway 平台,包含了api 相对比较完整的生命周期管理 同时在访问控制以及日志监控上也做的比较好,是一款可以尝试试用的api gateway ...

  7. 利用 Docker Compose 搭建 SpringBoot 运行环境(超详细步骤和分析)

    0.前言 相信点进来看这篇文章的同学们已经对 Docker Dompose 有一定的了解了,下面,我们拿最简单的例子来介绍如何使用 Docker Compose 来管理项目. 本文例子: 一个应用服务 ...

  8. [Docker6] Docker compose多容器运行与管理

    六.Docker compose docker compose就是通过yml文件来定义和运行多个容器docker应用程序的工具,三步过程就能跑起一个compose: 定义应用程序的环境(yml中) 定 ...

  9. [phvia/dkc] Docker Compose 快速构建(LNMP+Node)运行环境

    快速构建(LNMP+Node)运行环境. dkc 在此作为 docker-compose 的缩写,你可以理解为 alias dkc=docker-compose 准备 安装 docker 选择1) 从 ...

随机推荐

  1. 强震记录和GPS记录,地震波记录的区别

    强震记录的是加速度数据,但gps记录的是位移数据.这样的话,强震记录应该说是近场地震数据: 那么, 为什么不干脆用近场的地震波仪器呢,是因为,地震仪记录会限幅,导致记录不全.

  2. Problem(I) STL - 灵活的线性表

    Description 数组和链表是我们熟知的两种线性结构,但是它们不够灵活(不能同时实现直接插入.删除和访问操作),给你若干种操作,你能通过一种灵活的容器,实现它们的功能吗? 操作1:Build a ...

  3. 10.Python-第三方库requests详解(二)

    Requests 是用Python语言编写,基于 urllib,采用 Apache2 Licensed 开源协议的 HTTP 库.它比 urllib 更加方便,可以节约我们大量的工作,完全满足 HTT ...

  4. L255 Learning to say no brings a thrill of freedom

    I am not sure who came up with that thing about never saying yes to something in the distant future ...

  5. 18-10-15 服务器删除数据的方法【Elasticsearch 数据删除 (delete_by_query 插件安装使用)】方法二没有成功

    rpa 都是5.xx  ueba 分为2.0 或者5.0 上海吴工删除数据的方法 在许多项目中,用户提供的数据存储盘大小有限,在运行一段时间后,大小不够就需要删除历史的 Elasticsearch 数 ...

  6. ios中xib文件的用法

    ZQRView文件: // // ZQRView.h // // // Created by zzqqrr on 17/8/20. // // #import <UIKit/UIKit.h> ...

  7. ChinaCock界面控件介绍-CCNewsSilder

    上图是控件包里的Demo运行效果,轮播新闻图片. 这个控件用起来简单,拖放一个CCNewsSiler到Form上,设置Align为Top,再设置好高度,然后用代码加载图片: procedure TFo ...

  8. Python 爬虫的工具列表大全

    Python 爬虫的工具列表大全 这个列表包含与网页抓取和数据处理的Python库.网络 通用 urllib -网络库(stdlib). requests -网络库. grab – 网络库(基于pyc ...

  9. C语言——第三次作业(2)

    作业要求一 PTA作业的提交列表 第一次作业 第二次作业 一道编程题: 有一个axb的数组,该数组里面顺序存放了从1到a*b的数字.其中a是你大学号的前三位数字,b是你大学号的后四位数字,比如你的学号 ...

  10. Xposed Hook & Anti-hook

    一点简单记录. xposed原理包括将hook的method转为Native.因此可检测如下: for (ApplicationInfo applicationInfo : applicationIn ...