1. Introduction
This CLI quickstart guide has you deploying a simple Hello-world-ish PHP application ( powered by Slim framework ) on Arukas with the Arukas CLI tool.
Prerequisites:
- an Arukas Account
- Docker installed – see the installation guides for OS X, Windows and Linux.
2. Deploy an application to Arukas
There are basically two ways for now.
2.1. Deploy a PHP application to Arukas
Step One – Get you own API key
Deployment using Arukas CLI Tool is completed through key authentication.
Once you have an Arukas account, you can issue your API key in here.
API_TOKEN
SECRET_KEY
Step Two – Deploy a simple PHP application
Now it’s time to deploy a PHP application on Arukas.
We’ll use a dockerlized CLI in this quickstart guide instead of the binary version provided in here.
$ docker run --rm \
-e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
-e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
arukasio/arukas run \
--instances=1 \
--mem=512 \
--app-name="quickstart-php" \
--ports=80:tcp \
arukasio/quickstart-php
Parameters:
- instances: The number of instances
- mem:The Size of memory
- app-name: The name of application
- ports: Port number
Step Three – Check the applications you are running on Arukas
Let’s see if the deployment is completed.
ps
command returns information about your running applications.
$ docker run --rm \
-e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
-e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
arukasio/arukas ps
Table column:
- CONTAINER ID: Container id
- IMAGE: Image name
- COMMAND: Command executed to run an application
- CREATED: The date an application is created
- STATUS: Status
- NAME: Status of an application
- ENDPOINT: Domain name for the endpoint
Ex.
CONTAINER ID IMAGE COMMAND CREATED STATUS NAME ENDPOINT
0df30faa-ba63-49f5-a50f-efb27f899d26 arukasio/quickstart-php 2016-05-20T10:31:17.897+09:00 running drunk-shaw-8524 drunk-shaw-8524.arukascloud.io
Step Four – Access to the endpoint
Finally you can access to the endpoint.
$ curl https://<ENDPOINT>/hello/world
It will return “Hello, world“.
If you visit User control panel, there will be an application name “quickstart-php”.
Other commands:
start [OPTIONS] IMAGE
stop [OPTIONS] IMAGE
rm [OPTIONS] IMAGE
They are all self-explanatory, so we don’t get into the details.
More informations can be found by help
command.
$ docker run --rm \
-e ARUKAS_JSON_API_TOKEN="<API_TOKEN>" \
-e ARUKAS_JSON_API_SECRET="<SECRET_KEY>" \
arukasio/arukas help
3. What’s next?
Now you’ve deployed your very first application on Arukas.
If you already have your own Docker images, go ahead and just deploy them as we did so far. It’s basically the same thing.
We also provide different types of simple Hello-world-ish images on Docker Hub.
For more on Docker, visit the official documentation page. The scripts used in this quickstart guide are hosted on this GitHub page.