Giter VIP home page Giter VIP logo

wsi's Introduction

WSI

WSI is a Web Service Application which implements a RESTFul API.

Those services are a process's part of the Bigsea Project.

Building From Docker

Build Image

First of all, we need to build the docker image.

Before to build the docker image, you can modify the default configuration file. Indeed, when the docker image will be built, the configuration file located in the same directory of the Dockerfile will be imported into the image.

For example:

vim WSI/docker/wsi_config.xml

Once the configuration file is ready, from the repository root directory, launch:

cd WSI/docker
docker build --no-cache --force-rm -t wsi .

This will build a docker image tagged as wsi. Be patient, the building process could take several minutes.

Note that the docker image will be built with the configuration located in the same directory (i.e. WSI/docker/wsi_config.xml).

Once the images has been built, the WebService can be launched in a docker container.

Run Container

From the repository root directory, launch:

cd WSI/
export WSI_SERVICE_PORT=8080
docker run --name wsi_service -d -v ${PATH_YOUR_CUSTOM_CONFIG}:/home/wsi/wsi_config.xml -p ${WSI_SERVICE_PORT}:8080 wsi

where the enviroment variable WSI_SERVICE_PORT is the port where tomcat will listen to.

The options:

  • -d launchs the container in a demon process.
  • -v binds a custom configuration file in the container. If you want to use the default configuration just skip that option. The default configuration file has been defined when you have built the docker image.
  • -p allows the binding of the port.
  • --name sets the name of docker container.

Useful Commands and Informations

Restart Application

Since the configuration file is read only at the application's startup, when it is changed the application needs to be restarted.

In order to restart the docker container, just launch:

docker restart wsi_service

Configuration File

By default, the configuration file in the container is located in:

/home/wsi/wsi_config.xml

Database Creation

In order to create the mysql database schema a simple bash script has been provided.

cd Database
chmod u+x startNewDockerContainer.sh
sudo ./startNewDockerContainer.sh

The script is a simple wrap to docker commands. In order to launch the script you need to have a proper docker engine installed on your machine.

Before to launch the script you can modify the passwords and username directly open the script.

The script will launch a mysql docker container (exposing the mysql port) and it will populate the database with examples datas.

This script may require root privileges.

wsi's People

Contributors

biagiofesta avatar lattuada avatar tuliobraga avatar enricobarbierato avatar

Watchers

 avatar James Cloos 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.