Giter Club home page Giter Club logo

docker-tmf-apis's Introduction

Business Ecosystem APIs Docker Image

Starting on version 5.4.0, you are able to run the Business API Ecosystem with Docker. In this context, the current repository contains the Docker image with the Business Ecosystem APIs offered by the TMForum. As you may know, the different Business Ecosystem APIs require a MySQL database to store some information. For this reason, you must create an additional container to run the database. You can do it automatically with docker-compose or manually by following the given steps.

The current Docker image contains the whole set of TMForum APIs which are required by the Business API Ecosystem GE of FIWARE in order to work. In particular the following APIs are included:

Automatically

You can install the Business Ecosystem APIs automatically if you have docker-compose installed in your machine. To do so, you must create a folder to place a new file file called docker-compose.yml that should include the following content:

version: '3'

services:
    apis_db:
        image: mysql:latest
        ports:
            - "3333:3306"
        volumes:
            - ./apis-data:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD=my-secret-pw

    apis:
        image: conwetlab/biz-ecosystem-apis
        ports:
            - "4848:4848"
            - "8080:8080"
        links:
            - apis_db
        depends_on:
            - apis_db
        volumes:
            - ./apis-wars:/apis/wars-ext
            # Provided if configured by volume rather than by environment
            # - ./apis-config:/etc/default/tmf/
        environment:
            - BAE_SERVICE_HOST=http://proxy.docker:8004/
            - MYSQL_ROOT_PASSWORD=my-secret-pw
            - MYSQL_HOST=apis_db

Note: The provided docker-compose file is using a port schema that can be easily changed modifying the file

The APIs have a configuration option which can be used in order to specify the URL that should be used for generating href values. This setting can be configured in two different ways, using the BAE_SERVICE_HOST environment variable, or providing a server setting in a setting.properties file located at /etc/default/tmf The later implies mounting the directory of the file itself using a Docker volume.

Once you have created the file, run the following command for creating the containers:

docker-compose up

Then, the Business Ecosystem APIs should be up and running in http://${YOUR_HOST}:${PORT}/${API_PATH} replacing YOUR_HOST by the host of your machine, PORT by the port selected in the previous step, and API_PATH by the path of the particular API you are trying to access (As described in the previous section).

Once the different containers are running, you can stop them using:

docker-compose stop

And start them again using:

docker-compose start

Additionally, you can terminate the different containers by executing:

docker-compose down

Manually

1) Creating a Container to host the Database

The first thing that you have to do is to create a docker container that will host the database used by the Business Ecosystem APIs. To do so, you can execute the following command:

docker run --name apis_db -e MYSQL_ROOT_PASSWORD=my-secret-pw -p PORT:3306 -v /var/lib/mysql -d mysql

2) Deploying the Business Ecosystem APIs Image

Once that the database is configured, you can deploy the image by running the following command:

docker run -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_HOST=apis_db -p PORT:8080 --link apis_db conwetlab/biz-ecosystem-apis

Note: You can change the values of the MySQL connection (database password, and database host), but they must be same as the used when running the MySQL container.

Once that you have run these commands, be up and running in http://${YOUR_HOST}:${PORT}/${API_PATH} replacing YOUR_HOST by the host of your machine, PORT by the port selected in the previous step, and API_PATH by the path of the particular API you are trying to access (As described in the previous section).

docker-tmf-apis's People

Contributors

fdelavega avatar wistefan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.