HUB
Sign inSign up

congtaojiang/cpp-rest-server

By congtaojiang

•Updated over 8 years ago

A modified C++ Restful Server with MariaDB or MySQL access capabilities compliant with OpenShift.

Image
0

10K+

congtaojiang/cpp-rest-server repository overview

⁠Overview

cpp-rest-server is a restful server implemented in C++ using POCO libraries. it is dockerized and runs in Centos 7 container under restricted non-root privilege.

⁠Supported tags and respective Dockerfile

⁠Content

cpp-rest-server is deployed to /app/webservice folder with the main application(webservice) is located at /app/webservice/bin and dynamic dependencies are located at /app/webservice/lib.

⁠Environment Variables

The image requires the following environment variables related to MariaDB/MySQL configuration:

  • mysql_host: MariaDB/MySQL host or ip, default to localhost
  • mysql_user: database user name
  • mysql_pass: database user password
  • mysql_db: database/schema name, default is poco_webservice_schema

Image is built using the source code at https://github.com/jiangcongtao/poco_restful_webservice⁠

⁠Security

The webservice process is started using non-root user cppuser (password: cppuser) with sudo capability provided in the consideration of debugging and testing convience.

⁠Usage

⁠Initialize Database

Refer to Database initialization

⁠Start Container
docker run --rm -it -e mysql_host=<mysqlHost> -e mysql_user=<mysqlDbUser> -e mysql_pass=<mysqlDbUserPassword> -p 9090:9090 congtaojiang/cpp-rest-server
⁠Consume Restful API
curl -v -X GET --header 'Accept: application/vnd.api+json' --header 'Content-type: application/vnd.api+json' http://localhost:9090 

⁠Database initialization

Refer to https://github.com/jiangcongtao/poco_restful_webservice⁠

Tag summary

Content type

Image

Digest

Size

159.8 MB

Last updated

over 8 years ago

docker pull congtaojiang/cpp-rest-server