1. 程式人生 > 其它 >apisix和apisix-dashboard容器化部署

apisix和apisix-dashboard容器化部署

1.docker安裝etcd

docker run -it --name etcd-server \
-v /e/github/docker-apisix/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml \
-p 2379:2379 \
-p 2380:2380 \
--env ALLOW_NONE_AUTHENTICATION=yes \
-d bitnami/etcd

2.安裝apisix

docker run -v /config.yaml:/usr/local/apisix/conf/config.yaml -p 9080:9080 -p 2379:2379 -d apache/apisix
修改配置檔案對應的ip
apisix: node_listen:9080#APISIXlisteningport enable_ipv6:false
allow_admin:#http://nginx.org/en/docs/http/ngx_http_access_module.html#allow -0.0.0.0/0#Weneedtorestrictipaccessrulesforsecurity.0.0.0.0/0isfortest.
admin_key: -name:"admin" key:edd1c9f034335f136f87ad84b625c8f1 role:admin#admin:manageallconfigurationdata #viewer:onlycanviewconfigurationdata -name:"viewer" key:4054f7cf07e344346cd3f287985e76a2 role:viewer
etcd: host:#it'spossibletodefinemultipleetcdhostsaddressesofthesameetcdcluster. -"http://192.168.211.130:2379"#multipleetcdaddress prefix:"/apisix"#apisixconfigurationsprefix timeout:30#30seconds 3.安裝apisix-dashboard docker run -d -p 9000:9000 -v /path/to/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml --name apisix-dashboard apisix-dashboard 修改配置檔案

遇到ip adress not allowed的問題

解決:修改allow_list對應本機閘道器