{"id":25053739,"url":"https://github.com/hypertino/service-template","last_synced_at":"2025-03-31T07:23:28.765Z","repository":{"id":93931221,"uuid":"120780927","full_name":"hypertino/service-template","owner":"hypertino","description":"Scala dockerized service template with configuration, DI, logging, graceful shutdown, etc","archived":false,"fork":false,"pushed_at":"2018-02-09T15:51:10.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T11:57:14.058Z","etag":null,"topics":["dockerized","scala","service-template"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypertino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-08T15:40:44.000Z","updated_at":"2018-02-09T00:05:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"edbeccde-a48a-438a-b136-66708ffd8420","html_url":"https://github.com/hypertino/service-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypertino%2Fservice-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypertino%2Fservice-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypertino%2Fservice-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypertino%2Fservice-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypertino","download_url":"https://codeload.github.com/hypertino/service-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246430162,"owners_count":20775988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerized","scala","service-template"],"created_at":"2025-02-06T11:51:04.515Z","updated_at":"2025-03-31T07:23:28.755Z","avatar_url":"https://github.com/hypertino.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# service-template\n\nService template/example with logging, docker packaging, configuration handling and dependency injection.\nThis template utilizes concept of _target environment_, e.g. qa, stage, prod, local, etc. Target environment should \nbe provided to the service as `TARGET_ENV` environment variable or `targetEnv` java system property.\nIf not provided `local` environment is assumed.  \n\n# Howto\n\nBuild docker image: \n`sbt docker`\n\nBuild \u0026 run on host with target environment:\n\n```\nsbt ';set fork := true; set connectInput in run := true; set javaOptions ++= Seq(\"-DtargetEnv=qa\"); run'\n``` \n\nRun in docker as background daemon:\n\n```\ndocker run -d --name example-service -e TARGET_ENV=qa com.hypertino/service-template:latest\n```\n  \nRun interactively in docker and remove after it stops: \n```\ndocker run -it --rm -e TARGET_ENV=qa com.hypertino/service-template:latest\n```\n\nQuick run with docker-compose \n```\nTARGET_ENV=qa docker-compose up\n```\n\n# Dependencies\n\n## [service-config](https://github.com/hypertino/service-config)\n\nEnables configuration file where different environments specified within a single file.\nSee example in [application.conf](src/main/resources/application.conf)\n\nAlso adds transitive dependency to [TypeSafe Config](https://github.com/lightbend/config)\n\n## [typesafe-config-binders](https://github.com/hypertino/typesafe-config-binders)\n\nRead configuration to case class, example in [ExampleService.scala](src/main/scala/com/hypertino/example/ExampleService.scala)\n\n```scala\n  import com.hypertino.binders.config.ConfigBinders._\n  private val exampleConfig = config.read[ExampleConfig](\"example-service\")\n```\n\n## [service-control](https://github.com/hypertino/service-control)\n\nProvides basic `Service` interface, simple command-line with default `quit` command and shutdown hook for graceful shutdown.\nSee example with in [EntryPoint.scala](src/main/scala/com/hypertino/example/EntryPoint.scala)\n\nAlso adds transitive dependency to [Scaldi](http://scaldi.org/)\n\n## [logback](https://logback.qos.ch/) with logstash backend + [scala-logging](https://github.com/typesafehub/scala-logging)\n\nConfigure in [logback.xml](src/main/resources/logback.xml), [logback-qa.xml](src/main/resources/logback-qa.xml), [logback-prod.xml](src/main/resources/logback-prod.xml) \nand add more target environment log files if needed.\n\n## [sbt-buildinfo](https://github.com/sbt/sbt-buildinfo) plugin \n\nProvides compile-time access to build information. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypertino%2Fservice-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypertino%2Fservice-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypertino%2Fservice-template/lists"}