Skip to content

Commit

Permalink
Include docker guide contents
Browse files Browse the repository at this point in the history
  • Loading branch information
fdelavega committed Oct 23, 2018
1 parent 37b1a4c commit ca35c90
Showing 1 changed file with 213 additions and 0 deletions.
213 changes: 213 additions & 0 deletions doc/docker-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,216 @@
Docker Deployment Guide
=======================

This guide covers the deployment of the Business API Ecosystem version 7.4.0 using the Docker images provided in docker hub.

As stated, the Business API Ecosystem in made up of a set of different components which work jointly in order to provide
the functionality. In this regard the following images has been defined:

* fiware/biz-ecosystem-apis: This image includes all the TMForum APIs and can be found in `Docker Hub <>`__
* fiware/biz-ecosystem-charging-backend: This image includes the Charging Backend component and can be found in `Docker Hub <>`__
* fiware/biz-ecosystem-logic-proxy: This image includes the Logic Proxy component and can be found in `Docker Hub <https://hub.docker.com/r/fiware/biz-ecosystem-logic-proxy/>`__
* fiware/biz-ecosystem-rss: This Image include the Revenue Sharing Component and can be found in `Docker Hub <>`__

The easiest way to deploy the Business API Ecosystem with Docker is using *docker-compose*. The following *docker-compose.yml*
file deploys the whole system and databases (A running version of this file can be found in GitHub): ::

version: '3'
services:
mongo:
image: mongo:3.2
restart: always
ports:
- 27017:27017
networks:
main:
volumes:
- ./mongo-data:/data/db

mysql:
image: mysql:5.7
restart: always
ports:
- 3333:3306
volumes:
- ./mysql-data:/var/lib/mysql
networks:
main:
environment:
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_DATABASE=RSS

charging:
image: fiware/biz-ecosystem-charging-backend:v7.4.0
links:
- mongo
depends_on:
- mongo
networks:
main:
aliases:
- charging.docker
ports:
- 8006:8006
volumes:
# - ./charging-settings:/business-ecosystem-charging-backend/src/user_settings # Used if the settings files are provided through the volume
- ./charging-bills:/business-ecosystem-charging-backend/src/media/bills
- ./charging-assets:/business-ecosystem-charging-backend/src/media/assets
- ./charging-plugins:/business-ecosystem-charging-backend/src/plugins
- ./charging-inst-plugins:/business-ecosystem-charging-backend/src/wstore/asset_manager/resource_plugins/plugins
environment:
- BAE_CB_PAYMENT_METHOD=None # Paypal or None (testing mode payment disconected)
# - BAE_CB_PAYPAL_CLIENT_ID=client_id
# - BAE_CB_PAYPAL_CLIENT_SECRET=client_secret

# ----- Database configuration ------
- BAE_CB_MONGO_SERVER=mongo
- BAE_CB_MONGO_PORT=27017
- BAE_CB_MONGO_DB=charging_db
# - BAE_CB_MONGO_USER=user
# - BAE_CB_MONGO_PASS=passwd

# ----- Roles Configuration -----
- BAE_LP_OAUTH2_ADMIN_ROLE=admin
- BAE_LP_OAUTH2_SELLER_ROLE=seller
- BAE_LP_OAUTH2_CUSTOMER_ROLE=customer

# ----- Email configuration ------
- BAE_CB_EMAIL=charging@email.com
# - BAE_CB_EMAIL_USER=user
# - BAE_CB_EMAIL_PASS=pass
# - BAE_CB_EMAIL_SMTP_SERVER=smtp.server.com
# - BAE_CB_EMAIL_SMTP_PORT=587

- BAE_CB_VERIFY_REQUESTS=True # Whether or not the BAE validates SSL certificates on requests to external components

# ----- Site configuration -----
- BAE_SERVICE_HOST=http://proxy.docker:8004/ # External URL used to access the BAE
- BAE_CB_LOCAL_SITE=http://charging.docker:8006/ # Local URL of the charging backend

# ----- APIs Conection config -----
- BAE_CB_CATALOG=http://apis.docker:8080/DSProductCatalog
- BAE_CB_INVENTORY=http://apis.docker:8080/DSProductInventory
- BAE_CB_ORDERING=http://apis.docker:8080/DSProductOrdering
- BAE_CB_BILLING=http://apis.docker:8080/DSBillingManagement
- BAE_CB_RSS=http://rss.docker:8080/DSRevenueSharing
- BAE_CB_USAGE=http://apis.docker:8080/DSUsageManagement
- BAE_CB_AUTHORIZE_SERVICE=http://proxy.docker:8004/authorizeService/apiKeys

proxy:
image: fiware/biz-ecosystem-logic-proxy:v7.4.0
links:
- mongo
depends_on:
- mongo
networks:
main:
aliases:
- proxy.docker
ports:
- 8004:8000
volumes:
# - ./proxy-conf:/business-ecosystem-logic-proxy/etc # To be used when congiguring the system with a config file provided in the volume
- ./proxy-indexes:/business-ecosystem-logic-proxy/indexes
- ./proxy-themes:/business-ecosystem-logic-proxy/themes
- ./proxy-static:/business-ecosystem-logic-proxy/static
- ./proxy-locales:/business-ecosystem-logic-proxy/locales
environment:
- NODE_ENV=development # Deployment in development or in production
- COLLECT=True # Execute the collect static command on startup

- BAE_LP_PORT=8000 # Port where the node service is going to run in the container
- BAE_LP_HOST=proxy.docker # Host where the node service if going to run in the container
# - BAE_SERVICE_HOST=https://store.lab.fiware.org/ # If provided, this URL specifies the actual URL that is used to access the BAE, when the component is proxied (e.g Apache)
# - BAE_LP_HTTPS_ENABLED=true # If provided specifies whether the service is running in HTTPS, default: false
# - BAE_LP_HTTPS_CERT=cert/cert.crt # Certificate for the SSL configuration (when HTTPS enabled is true)
# - BAE_LP_HTTPS_CA=cert/ca.crt # CA certificate for the SSL configuration (when HTTPS enabled is true)
# - BAE_LP_HTTPS_KEY=cert/key.key # Key sfile for the SSL configuration (when HTTPS enabled is true)
# - BAE_LP_HTTPS_PORT=443 # Port where the service runs when SSL is enabled (when HTTPS enabled is true)

# ------ OAUTH2 Config ------
- BAE_LP_OAUTH2_SERVER=http://idm.docker:8000 # URL of the FIWARE IDM used for user authentication
- BAE_LP_OAUTH2_CLIENT_ID=id # OAuth2 Client ID of the BAE applicaiton
- BAE_LP_OAUTH2_CLIENT_SECRET=secret # OAuth Client Secret of the BAE application
- BAE_LP_OAUTH2_CALLBACK=http://proxy.docker:8004/auth/fiware/callback # Callback URL for receiving the access tokens
- BAE_LP_OAUTH2_ADMIN_ROLE=admin # Role defined in the IDM client app for admins of the BAE
- BAE_LP_OAUTH2_SELLER_ROLE=seller # Role defined in the IDM client app for sellers of the BAE
- BAE_LP_OAUTH2_CUSTOMER_ROLE=customer # Role defined in the IDM client app for customers of the BAE
- BAE_LP_OAUTH2_ORG_ADMIN_ROLE=orgAdmin # Role defined in the IDM client app for organization admins of the BAE
- BAE_LP_OAUTH2_IS_LEGACY=false # Whether the used FIWARE IDM is version 6 or lower

# - BAE_LP_THEME=theme # If provided custom theme to be used by the web site, it must be included in themes volume

# ----- Mongo Config ------
# - BAE_LP_MONGO_USER=user
# - BAE_LP_MONGO_PASS=pass
- BAE_LP_MONGO_SERVER=mongo
- BAE_LP_MONGO_PORT=27017
- BAE_LP_MONGO_DB=belp

- BAE_LP_REVENUE_MODEL=30 # Default market owner precentage for Revenue Sharing models

# ----- APIs Configuration -----
# If provided, it supports configuring the contection to the different APIs managed by the logic proxy, by default
# apis.docker, charging.docker and rss.docker domains are configured
# - BAE_LP_ENDPOINT_CATALOG_PATH=DSProductCatalog
# - BAE_LP_ENDPOINT_CATALOG_PORT=8080
# - BAE_LP_ENDPOINT_CATALOG_HOST=apis.docker
# - BAE_LP_ENDPOINT_CATALOG_SECURED=false
# ...

apis:
image: fiware/biz-ecosystem-apis:v7.4.0
restart: always
ports:
- 4848:4848
- 8080:8080
links:
- mysql
depends_on:
- mysql
networks:
main:
aliases:
- apis.docker
# volumes:
# - ./apis-conf:/etc/default/tmf/ # Used if not configured by environment
environment:
- BAE_SERVICE_HOST=http://proxy.docker:8004/
- MYSQL_ROOT_PASSWORD=my-secret-pw
- MYSQL_HOST=mysql

rss:
image: fiware/biz-ecosystem-rss:v7.4.0
restart: always
ports:
- 9999:8080
- 4444:4848
- 1111:8181
links:
- mysql
depends_on:
- mysql
networks:
main:
aliases:
- rss.docker
# volumes:
# - ./rss-conf:/etc/default/rss # Used if not configured by environment
environment:
- BAE_SERVICE_HOST=http://proxy.docker:8004/
- BAE_LP_OAUTH2_ADMIN_ROLE=admin # Role defined in the IDM client app for admins of the BAE
- BAE_LP_OAUTH2_SELLER_ROLE=seller # Role defined in the IDM client app for sellers of the BAE
- BAE_RSS_MYSQL_ROOT_PASSWORD=my-secret-pw
- BAE_RSS_MYSQL_ROOT_HOST=mysql
networks:
main:
external: true

.. note::
The previous example use an external network called main, which need to exist. If you do not want to use such network just remove the network tags

The different images provided can be configured in two different ways as it is done with the software. On the one hand,
configuration parameters can be included as environment variables (as shown in the example). On the other hand, the different
images can be configured by providing configuration files throught volumes.

For details on the different configuration options, please refer to the *Configuration Guide*

0 comments on commit ca35c90

Please sign in to comment.