docker镜像部署 APISIX

镜像版本

镜像镜像版本
APISIXapache/apisix:3.2.2
ETCDbitnami/etcd:3.4.9
APISIX Dashboardapache/apisix-dashboard:3.0.0-alpine

配置文件

apisix-conf/config.yaml

apisix:
  node_listen: 9080
  enable_ipv6: false

deployment:
  admin:
    allow_admin:                 
      - 0.0.0.0/0 
    admin_key:
      - name: "admin"
        key: edd1c9f034335f136f87ad84b625c8f1
        role: admin                 
                                  
      - name: "viewer"
        key: 4054f7cf07e344346cd3f287985e76a2
        role: viewer
  admin_listen:
     ip: 0.0.0.0                 
     port: 9180                  
  etcd:
    host:                           
      - "http://{{IP}}:2379"            
    timeout: 30

apisix-dashboard/conf.yaml

conf:
  listen:
    host: 0.0.0.0 # `manager api` listening ip or host name
    port: 9000 # `manager api` listening port
  etcd:
    endpoints: # supports defining multiple etcd host addresses for an etcd cluster
      - {{ETCDIP}}:2379      # etcd ip
  log:
    error_log:
      level: warn # supports levels, lower to higher: debug, info, warn, error, panic, fatal
      file_path:
        logs/error.log # supports relative path, absolute path, standard output
        # such as: logs/error.log, /tmp/logs/error.log, /dev/stdout, /dev/stderr
authentication:
  secret:
    secret # secret for jwt token generation.
    # NOTE: Highly recommended to modify this value to protect `manager api`.
    # if it's default value, when `manager api` start , it will generate a random string to replace it.
  expire_time: 3600 # jwt token expire time, in second
  users:
    - username: admin # username and password for login `manager api`
      password: admin
    - username: user
      password: user

docker启动命令

-- 启动etcd
docker run -d --name etcd -p 2379:2379 -p 2380:2380 -v /opt/apisix//etcd_data:/etcd_data -e "ALLOW_NONE_AUTHENTICATION=yes" bitnami/etcd:3.4.9
-- 启动apisix
docker run -d --name apisix -p 9080:9080 -p 9443:9443  -p 9180:9180 -v /opt/apisix/apisix-conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro apache/apisix:latest
-- 启动apisix dashboard
docker run -d --name apisix-dashboard -p 9000:9000 -v /opt/apisix/apisix-dashboard/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml apache/apisix-dashboard:3.0.0-alpine
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值