{"id":20408846,"url":"https://github.com/dockersamples/wordsmith","last_synced_at":"2025-05-15T08:05:07.577Z","repository":{"id":37444262,"uuid":"116800189","full_name":"dockersamples/wordsmith","owner":"dockersamples","description":"Sample project with Docker containers running under Kubernetes","archived":false,"fork":false,"pushed_at":"2024-11-27T18:36:34.000Z","size":404,"stargazers_count":269,"open_issues_count":6,"forks_count":485,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-11T10:08:23.727Z","etag":null,"topics":["demo","docker","docker-compose","example","kubernetes","sample","swarm"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dockersamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-09T10:15:33.000Z","updated_at":"2025-04-09T09:02:00.000Z","dependencies_parsed_at":"2024-02-01T04:47:15.800Z","dependency_job_id":"0be85189-0619-4600-a87c-3d80d3672b83","html_url":"https://github.com/dockersamples/wordsmith","commit_stats":{"total_commits":29,"total_committers":10,"mean_commits":2.9,"dds":0.7241379310344828,"last_synced_commit":"23c61bba9a4c163e5011a7072cbdfd07128acec0"},"previous_names":["dockersamples/k8s-wordsmith-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fwordsmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fwordsmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fwordsmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fwordsmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dockersamples","download_url":"https://codeload.github.com/dockersamples/wordsmith/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301422,"owners_count":22047901,"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":["demo","docker","docker-compose","example","kubernetes","sample","swarm"],"created_at":"2024-11-15T05:37:22.760Z","updated_at":"2025-05-15T08:05:07.532Z","avatar_url":"https://github.com/dockersamples.png","language":"Java","readme":"# Wordsmith App\n\nWordsmith is the demo project originally shown at DockerCon EU 2017 and 2018.\n\nThe demo app runs across three containers:\n\n- **[api](api/Dockerfile)** - a Java REST API which serves words read from the database\n- **[web](web/Dockerfile)** - a Go web application that calls the API and builds words into sentences\n- **db** - a Postgres database that stores words\n\n## Architecture\n\n![Architecture diagram](architecture.excalidraw.png)\n\n## Build and run in Docker Compose\n\nThe only requirement to build and run the app from source is Docker. Clone this repo and use Docker Compose to build all the images. You can use the new V2 Compose with `docker compose` or the classic `docker-compose` CLI:\n\n```shell\ndocker compose up --build\n```\n\nOr you can pull pre-built images from Docker Hub using `docker compose pull`.\n\n\n## Deploy using Kubernetes manifests\n\nYou can deploy the same app to Kubernetes using the [Kustomize configuration](./kustomization.yaml). It will define all of the necessary Deployment and Service objects and a ConfigMap to provide the database schema.\n\nApply the manifest using `kubectl` while at the root of the project:\n\n```shell\nkubectl apply -k .\n```\n\nOnce the pods are running, browse to http://localhost:8080 and you will see the site.\n\nDocker Desktop includes Kubernetes and the [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) command line, so you can work directly with the cluster. Check the services are up, and you should see output like this:\n\n```text\nkubectl get svc\nNAME         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE\ndb           ClusterIP      None             \u003cnone\u003e        55555/TCP        2m\nkubernetes   ClusterIP      10.96.0.1        \u003cnone\u003e        443/TCP          38d\nweb          LoadBalancer   10.107.215.211   \u003cpending\u003e     8080:30220/TCP   2m\nwords        ClusterIP      None             \u003cnone\u003e        55555/TCP        2m\n```\n\nCheck the pods are running and you should see one pod each for the database and web components and five pods for the words API:\n\n```text\nkubectl get pods\nNAME                   READY     STATUS    RESTARTS   AGE\ndb-8678676c79-h2d99    1/1       Running   0          1m\nweb-5d6bfbbd8b-6zbl8   1/1       Running   0          1m\napi-858f6678-6c8kk     1/1       Running   0          1m\napi-858f6678-7bqbv     1/1       Running   0          1m\napi-858f6678-fjdws     1/1       Running   0          1m\napi-858f6678-rrr8c     1/1       Running   0          1m\napi-858f6678-x9zqh     1/1       Running   0          1m\n```\n","funding_links":[],"categories":["Simple Apps (1-3 independent services/apps in solution)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fwordsmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockersamples%2Fwordsmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fwordsmith/lists"}