docker搭建Apisix和Apisix Dashboard

第一步:github下载源码

参考:https://apisix.apache.org/zh/docs/apisix/installation-guide/

复制代码
git clone https://github.com/apache/apisix-docker.git
cd apisix-docker/example

第二步:添加Apisix Dashboard镜像

打开./apisix-docker/example/docker-compose.yaml的services:部分添加apisix-dashboard镜像依赖

复制代码
apisix-dashboard:
    image: apache/apisix-dashboard:3.0.1-alpine
    restart: always
    volumes:
      - ./dashboard_conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml
    depends_on:
      - etcd
    ports:
      - "9000:9000/tcp"
    networks:
      apisix:
    environment:
      - TZ=Asia/Shanghai

第三步:Apisix Dashboard镜像需要挂载配置文件

创建文件夹及文件:参考https://ryanchan.top/archives/optimizing-api-management-and-traffic-control-with-apisix-dashboard

复制代码
./dashboard_conf/conf.yaml

conf:
  listen:
    port: 9000           
  allow_list:            
    - 127.0.0.1          
    - ::1                
    - 0.0.0.0/0                   
  etcd:
    endpoints:            
      - etcd:2379
    mtls:
      key_file: ""         
      cert_file: ""        
      ca_file: ""         
  log:
    error_log:
      level: warn      
      file_path:
        logs/error.log  
    access_log:
      file_path:
        logs/access.log 
  max_cpu: 0             
authentication:
  secret:
    secret             
  expire_time: 3600     
  users:                
    - username: admin  
      password: admin

plugins:                         
  - api-breaker
  - authz-keycloak
  - basic-auth
  - batch-requests
  - consumer-restriction
  - cors
  - echo
  - fault-injection
  - grpc-transcode
  - hmac-auth
  - http-logger
  - ip-restriction
  - jwt-auth
  - kafka-logger
  - key-auth
  - limit-conn
  - limit-count
  - limit-req
  - openid-connect
  - prometheus
  - proxy-cache
  - proxy-mirror
  - proxy-rewrite
  - redirect
  - referer-restriction
  - request-id
  - request-validation
  - response-rewrite
  - serverless-post-function
  - serverless-pre-function
  - sls-logger
  - syslog
  - tcp-logger
  - udp-logger
  - uri-blocker
  - wolf-rbac
  - zipkin
  - server-info
  - traffic-split

第四步:启动

复制代码
# 启动
docker-compose -p docker-apisix up -d
# 删除
docker-compose -p docker-apisix down
相关推荐
二宝哥13 天前
docker安装apisix
docker·容器·apisix
成为你的宁宁14 天前
【APISIX:部署、路由与 Nacos 集成】
微服务·nacos·apisix·api网关
hopsky17 天前
apisix 高性能利用worker方案
apisix
SLD_Allen24 天前
HxApisix 云原生 API 网关的架构设计与 AI 集成实践(THS)
人工智能·网关·云原生·apisix
衣舞晨风4 个月前
运行时行为盲区:API7 AI 网关CPU打满故障的AI辅助事后复盘
lua·openresty·apisix·coroutine·cpu-saturation·socket-buffer
闫小甲6 个月前
Spring Cloud Gateway vs Apache APISIX:统一网关与鉴权方案深度对比
微服务·架构·apisix·ssg
我发在否9 个月前
APISIX > ai-proxy 插件
apisix·ai网关
Cloud孙文波1 年前
探索Apache APISIX:动态高性能API网关
云原生·kubernetes·apisix
TracyCoder1231 年前
APISIX 简介:云原生 API 网关的架构与实践
云原生·架构·apisix