Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Manages drugs both through GRPC and HTTP service.

Notifications You must be signed in to change notification settings

drmarjanovic/prescription-drugs

Repository files navigation

scala-version

Prescription Drugs Service

Manages drugs both through GRPC service. Also, supports prescription retrieving using HTTP and SFTP.

Running

Application has following environment variables:

Variable Description Required Default
HTTP_PORT Port of the HTTP service is listening on. NO 8080
SFTP_HOST Host of the SFTP server. YES /
SFTP_PORT Port of the SFTP server. NO 22
SFTP_USERNAME Username required for SFTP server authenticating. YES /
SFTP_PASSWORD Password required for SFTP server authenticating. YES /

To setup environment variables in the application, please provide .env file in the root of the project.

After configuring environment variables application can be started via command:

sbt run

Data

In order to use a GRPC service that tests whether the drug is available or not, please provide data in the src/main/resources/db/drugs.json file.

Note: Data is not persisted and will be restarted every time service is up and running.

Infrastructure

Third-party services that our service depends on are defined in the docker-compose.yml file. Start it using following command:

docker-compose -f docker-compose.yml up -d

SFTP

emberstack/sftp represents a Docker image for hosting a SFTP server. SFTP configuration is defined in the sftp.json file.

Building and running a Docker image

Building a Docker image is automated through the shell script:

./ci.sh

In order to start a container use a following command:

docker run -p 8080:8080 -p 9000:9000 --env-file .env prescription-drugs:latest

Note: It's recommended to use 8080 for an HTTP port.

About

Manages drugs both through GRPC and HTTP service.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published