Sign inSign up

brnnai/greeting-service

By brnnai

•Updated over 3 years ago

Simple springboot REST API to use at the aws white belt trainning

Image
0

360

brnnai/greeting-service repository overview

⁠Greeting API Docker Image

This Docker image encapsulates a Spring-based microservice application known as the Greeting API. The API connects to a MySQL database to fetch, create, update, and delete greetings. The endpoints, data schemas, and detailed operations are specified according to the OpenAPI 3.0.0 specification.

Github repository S2⁠

⁠Quick Reference

  • Image Name: brnnai/greeting-service:tag
  • Maintained by: brnnai
  • Where to get help: your contact details or preferred communication channel

⁠How to Use This Image

⁠Starting a greeting-api Instance

Starting a greeting-api instance is as simple as running the following command. Be sure to replace your_username and tag with your Docker username and the image tag:

docker run --name service-greeting-api -d brnnai/greeting-service:latest

⁠Configuration

You can customize this Docker image using several environment variables:

  • SPRING_DATASOURCE_URL: This is the JDBC URL for your MySQL database. Replace mysql_db with your MySQL server's hostname or IP address, and greetingsdb with your database's name. Example: jdbc:mysql://localhost:3306/greetingsdb
  • DATASOURCE_USERNAME: The username for your MySQL database. Example: root
  • DATASOURCE_PASSWORD: The password for your MySQL database.
  • LOG_LEVEL: The log level for the application. This can be set to DEBUG, INFO, WARN, or ERROR. By default, it is set to INFO.

You can set these variables using the -e flag in the docker run command:

docker run -d --name greeting-api \
  -e SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/greetingsdb \
  -e DATASOURCE_USERNAME=root \
  -e DATASOURCE_PASSWORD=mypassword \
  -e LOG_LEVEL=INFO \
  -p 8080:8080 \
  brnnai/greeting-service:latest

⁠Ports

The application listens on port 8080 for HTTP traffic. You can map this to any port on your host machine using the -p flag in the docker run command.

⁠Dependencies

This application requires a MySQL server to function correctly. The SPRING_DATASOURCE_URL environment variable should point to a running MySQL server instance.

Tag summary

Content type

Image

Digest

sha256:175c3e394…

Size

263.6 MB

Last updated

over 3 years ago

docker pull brnnai/greeting-service