blob: 9e0707e66837882f4256c17f91df528c424aa81c [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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: "3"
services:
apisix:
image: apache/apisix:dev
restart: always
volumes:
- ./apisix_log:/usr/local/apisix/logs
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:ro
depends_on:
- etcd
##network_mode: host
ports:
- "9080:9080/tcp"
- "9443:9443/tcp"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.11
etcd:
image: bitnami/etcd:3.4.9
user: root
restart: always
volumes:
- ./etcd_data:/etcd_data
environment:
ETCD_DATA_DIR: /etcd_data
ETCD_ENABLE_V2: "true"
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ports:
- "2379:2379/tcp"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.10
web1:
image: ruby:2-alpine
command: sh -c "mkdir -p /tmp/www && echo 'web1' > /tmp/www/web1.txt && ruby -run -ehttpd /tmp/www -p8000"
restart: always
ports:
- "9081:8000/tcp"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.12
web2:
image: ruby:2-alpine
command: sh -c "mkdir -p /tmp/www && echo 'web2' > /tmp/www/web2.txt && ruby -run -ehttpd /tmp/www -p8000"
restart: always
ports:
- "9082:8000/tcp"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.13
mysql:
image: mysql:latest
restart: always
ports:
- "3309:3306/tcp"
environment:
- MYSQL_ROOT_PASSWORD=123456
volumes:
- /tmp/datadir:/var/lib/mysql
- /tmp/conf.d:/etc/mysql/conf.d
- ../api/script/db:/docker-entrypoint-initdb.d
networks:
apisix-dashboard:
ipv4_address: 192.17.5.14
manager:
build:
context: ./../api
dockerfile: Dockerfile
restart: always
ports:
- "8080:8080/tcp"
environment:
- ENV=prod
volumes:
- ./manager_conf/build.sh:/root/manager-api/build.sh
networks:
apisix-dashboard:
ipv4_address: 192.17.5.15
prometheus:
image: prom/prometheus
hostname: prometheus
restart: always
volumes:
- ./prometheus_conf/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.16
grafana:
image: grafana/grafana
container_name: grafana
hostname: grafana
restart: always
ports:
- "3000:3000"
volumes:
- "./grafana_conf/provisioning:/etc/grafana/provisioning"
- "./grafana_conf/dashboards:/var/lib/grafana/dashboards"
- "./grafana_conf/config/grafana.ini:/etc/grafana/grafana.ini"
networks:
apisix-dashboard:
ipv4_address: 192.17.5.17
dashboard:
build:
context: ./..
dockerfile: Dockerfile
restart: always
ports:
- "80:80/tcp"
networks:
apisix-dashboard:
driver: bridge
ipam:
config:
- subnet: 192.17.0.0/16