• Stars
    star
    257
  • Rank 158,728 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample project with Docker containers running under Kubernetes

Wordsmith App

Wordsmith is the demo project originally shown at DockerCon EU 2017 and 2018.

The demo app runs across three containers:

  • api - a Java REST API which serves words read from the database
  • web - a Go web application that calls the API and builds words into sentences
  • db - a Postgres database that stores words

Architecture

Architecture diagram

Build and run in Docker Compose

The 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:

docker compose up --build

Or you can pull pre-built images from Docker Hub using docker compose pull.

Deploy using Kubernetes manifests

You can deploy the same app to Kubernetes using the Kustomize configuration. It will define all of the necessary Deployment and Service objects and a ConfigMap to provide the database schema.

Apply the manifest using kubectl while at the root of the project:

kubectl apply -k .

Once the pods are running, browse to http://localhost:8080 and you will see the site.

Docker Desktop includes Kubernetes and the kubectl command line, so you can work directly with the cluster. Check the services are up, and you should see output like this:

kubectl get svc
NAME         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
db           ClusterIP      None             <none>        55555/TCP        2m
kubernetes   ClusterIP      10.96.0.1        <none>        443/TCP          38d
web          LoadBalancer   10.107.215.211   <pending>     8080:30220/TCP   2m
words        ClusterIP      None             <none>        55555/TCP        2m

Check the pods are running and you should see one pod each for the database and web components and five pods for the words API:

kubectl get pods
NAME                   READY     STATUS    RESTARTS   AGE
db-8678676c79-h2d99    1/1       Running   0          1m
web-5d6bfbbd8b-6zbl8   1/1       Running   0          1m
api-858f6678-6c8kk     1/1       Running   0          1m
api-858f6678-7bqbv     1/1       Running   0          1m
api-858f6678-fjdws     1/1       Running   0          1m
api-858f6678-rrr8c     1/1       Running   0          1m
api-858f6678-x9zqh     1/1       Running   0          1m

More Repositories

1

example-voting-app

Example distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes
C#
4,558
star
2

docker-swarm-visualizer

A visualizer for Docker Swarm Mode using the Docker Remote API, Node.JS, and D3
JavaScript
3,250
star
3

atsea-sample-shop-app

A sample app that uses a Java Spring Boot backend connected to a database to display a fictitious art shop with a React front-end.
Java
688
star
4

101-tutorial

JavaScript
335
star
5

compose-dev-env

Example used to try a compose application with Docker Dev Environments
Go
137
star
6

docker-fifth-birthday

100
star
7

node-bulletin-board

Sample bulletin board app in Node.js and Vue.js
JavaScript
98
star
8

single-dev-env

Example used to try a single container sample of Docker Dev Environments
Go
86
star
9

dockercoins

HTML
71
star
10

global-2018-hol

Hands-On labs for the global 2018 event series
PHP
59
star
11

aspnet-monitoring

Monitoring ASP.NET Fx applications in Windows Docker containers, using Prometheus
JavaScript
56
star
12

linux_tweet_app

A very simple webapp based on NGINX
HTML
47
star
13

javaee-demo

Demo migrating a JavaEE application to Docker
Java
40
star
14

newsletter-signup

Newsletter Sign Up - a .NET Framework app using Docker containers on Windows
JavaScript
28
star
15

docker-hub-ml-project

Python
27
star
16

gopher-task-system

A Task System using Go Docker SDK.
Go
20
star
17

buildme

buildme
Dockerfile
18
star
18

windows-2003

Sample apps taken from Windows Server 2003 and running in Docker Windows containers
Dockerfile
14
star
19

link-shortener-typescript

A Simple URL Shortener built using TypeScript and Nest.js powered with Docker
TypeScript
14
star
20

wearedevelopers-2023

The sample application used for Docker's WeAreDevelopers 2023 talk
JavaScript
8
star
21

elastic-windows

Samples for Elasticsearch and Kibana running in Windows Docker containers
PowerShell
7
star
22

helloworld-demo-python

Demonstrating Hello World Python Example for docker init CLI
Python
7
star
23

student-record-management

Building a Student Record Management app using .NET and Docker
C#
7
star
24

docker-init-demos

Sample apps to demonstrate the power of docker init
Rust
6
star
25

.github

5
star
26

node-mongo-docker

Creating a REST API using Node, Mongo and Docker
JavaScript
3
star
27

dotnetconf19

Code for the 2019 .NET Conf challenge
C#
2
star
28

helloworld-demo-node

Example used to demonstrate docker init CLI for a simple Hello World Node Program
Dockerfile
2
star
29

build-cloud-cookbook

Rust
2
star
30

dind-rapid7

Shell
1
star
31

project-template

A Sample repository template for a new project
Dockerfile
1
star