arukas 的 Endpoint

来源:互联网 发布:广州小孩学编程 编辑:程序博客网 时间:2024/06/10 22:15
arukas 的 Endpoint

什么是端点 What is Endpoint

arukas.io 的实例几乎每周都自动重新启动,当实例重新启动时,其端口会更改。IP地址和端口的平均寿命是一周,有时它在一天内变化。

但是,端点URL始终相同。永远在线的连接应该是通过端点。

端点URL仅映射到实例的第一个端口。

例如:
端口#1:3456 <=映射到端点
端口#2:80
端口#3:443

端点需要在端点启用后打开所有端口。

EndPoint URL是HTTP后端支持,主要用于Web服务器和API服务器。


arukas 的 Endpoint 默认映射到第一个端口。如果建立的 app 中只开通了一个端口,如31098 (80/tcp),那 Endpoint 自然映射到这个端口;如果建立的 app 中只开通了多个端口,Endpoint 则不知道指向那个端口。

这时候自然用到端口转发,这里有个centos7的样例,测试成功。


/////////////////////////////////////////////////////////////////

https://arukas.io/en/tutorials-en/tutorials-python-en/

从  https://app.arukas.io/settings/api-keys  获取 Token  和 Secret

安装 docker  :  apt-get install docker.io
安装 arukasio_cli  https://github.com/arukasio/cli
                   docker run --rm -e ARUKAS_JSON_API_TOKEN="账户的 TOKEN" -e ARUKAS_JSON_API_SECRET="账户的 SECRET" arukasio/arukas
                   
在当前目录建立 .env 文件

ARUKAS_JSON_API_TOKEN=账户的 TOKEN
ARUKAS_JSON_API_SECRET=账户的 SECRET
ARUKAS_JSON_API_URL=

arukasio_cli 管理

Commands:
  help [<command>...]
    Show help.

  ps [<flags>]
    Show status of containers

  rm <container_id>
    Remove a container

  run --instances=INSTANCES --mem=MEM --ports=PORTS [<flags>] <image>
    Create and run a container. The container must run as a daemon.

  start <container_id>
    Start one stopped container

  stop <container_id>
    Stop one running container


Docker 管理
docker run --rm \
 -e ARUKAS_JSON_API_TOKEN="应用的 TOKEN " \
 -e ARUKAS_JSON_API_SECRET="应用的 SECRET" \
 arukasio/arukas run \
 --instances=1 \
 --mem=512 \
 --app-name="quickstart-php" \
 --ports=80:tcp \
 arukasio/quickstart-php

https://github.com/arukasio/docker-hub-images

0 0
原创粉丝点击