auth-serving-docker.yaml 2.5 KB
Newer Older
T
TeslaZhao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
version: '3'

volumes:
  kong_data: {}

services:
  db:
    image: postgres:9.6
    environment:
      - POSTGRES_DB=kong
      - POSTGRES_USER=kong
      - POSTGRES_PASSWORD=kong
    volumes:
      - kong_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: always

  kong-migrations:
    image: registry.baidubce.com/serving_gateway/kong:paddle
    command: kong migrations bootstrap
    depends_on:
      - db
    environment:
      - KONG_DATABASE=postgres
      - KONG_PG_DATABASE=kong
      - KONG_PG_HOST=db
      - KONG_PG_USER=kong
      - KONG_PG_PASSWORD=kong
    restart: on-failure

  kong:
    image: registry.baidubce.com/serving_gateway/kong:paddle
    depends_on:
      - db
      - redis
    environment:
      - KONG_DATABASE=postgres
      - KONG_PG_HOST=db
      - KONG_PG_DATABASE=kong
      - KONG_PG_USER=kong
      - KONG_PG_PASSWORD=kong
      # - KONGKA_REDIS_HOST=redis
      # - KONGKA_REDIS_PORT=6379
      # - KONGKA_REDIS_DATABASE=0
    ports:
      - 8000:8000/tcp
      - 127.0.0.1:8001:8001/tcp
      - 8443:8443/tcp
      - 127.0.0.1:8444:8444/tcp
    healthcheck:
      test: ["CMD", "kong", "health"]
      interval: 10s
      timeout: 10s
      retries: 10
    restart: always

  kong-prepare:
    image: registry.baidubce.com/serving_gateway/kong:paddle
    entrypoint: ["bash", "/autoconfigure-admin-api.sh"]
    depends_on:
      - kong
    restart: on-failure

  konga-prepare:
    image: pantsel/konga:next
    command: -c prepare -a postgres -u postgresql://kong:kong@db/konga
    depends_on:
      - db
    restart: on-failure
    healthcheck:
      test: "exit 0"

  konga:
    image: pantsel/konga:next
    environment:
      - DB_ADAPTER=postgres
      - DB_HOST=db
      - DB_USER=kong
      - DB_PASSWORD=kong
      - DB_DATABASE=konga
      - NODE_ENV=production
    depends_on:
      - db
      - konga-prepare
    ports:
      - 8005:1337/tcp

    restart: always

  redis:
    image: redis:latest
    ports:
      - 6379:6379
    restart: always

  serving:
    image: registry.baidubce.com/serving_dev/serving-runtime:cpu-py36
    ports:
      - 9393:9393
    command: bash -c "
            wget --no-check-certificate https://paddle-serving.bj.bcebos.com/uci_housing.tar.gz
            && tar -xzf uci_housing.tar.gz
            && python3.6 -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9393 --name uci
        "
    restart: always