{"id":17930922,"url":"https://github.com/trainingdemos/k8s-frontend-basic","last_synced_at":"2026-04-10T17:04:46.176Z","repository":{"id":259257610,"uuid":"875949543","full_name":"trainingdemos/k8s-frontend-basic","owner":"trainingdemos","description":"A basic web page that displays a confirmation message","archived":false,"fork":false,"pushed_at":"2024-10-24T12:29:33.000Z","size":555,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T23:45:37.468Z","etag":null,"topics":["demo","docker","kubernetes","nextjs","nginx","training-materials","typescript"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/trainingdemos/k8s-frontend-basic","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trainingdemos.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":"2024-10-21T06:36:56.000Z","updated_at":"2024-10-24T12:29:36.000Z","dependencies_parsed_at":"2024-12-16T06:42:31.803Z","dependency_job_id":"ff83041d-515a-4468-901b-6b5a705015ea","html_url":"https://github.com/trainingdemos/k8s-frontend-basic","commit_stats":null,"previous_names":["trainingdemos/k8s-frontend-basic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trainingdemos%2Fk8s-frontend-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trainingdemos%2Fk8s-frontend-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trainingdemos%2Fk8s-frontend-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trainingdemos%2Fk8s-frontend-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trainingdemos","download_url":"https://codeload.github.com/trainingdemos/k8s-frontend-basic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246982480,"owners_count":20864098,"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","kubernetes","nextjs","nginx","training-materials","typescript"],"created_at":"2024-10-28T21:18:37.016Z","updated_at":"2025-12-30T23:09:30.419Z","avatar_url":"https://github.com/trainingdemos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-frontend-basic\n\nThis project creates a container image that displays a basic web page, built using [Next.js](https://nextjs.org) and delivered by [Nginx](https://nginx.org), for deployment into [Kubernetes](https://kubernetes.io). It is intended to be used as part of a lab exercise or an intructor-led walkthrough.\n\nWhen running it presents a basic web page displaying a confirmation message:\n\n\u003cimg src=\"https://static.noomedia.com/images/README/k8s-frontend-basic/screenshot.png\" width=\"500\"\u003e\n\n## Verifying\n\nIf [Node.js](https://nodejs.org) is installed locally, you can run the following commands from within the cloned directory to verify that the application works:\n\n```bash\nnpm install\nnpm run dev\n```\n\nThis will start a local web server running on port `3000`. The application can then be verified by visiting [http://localhost:3000](http://localhost:3000) in a web browser.\n\n## Building\n\nTo build the container image you will need to have [Docker](https://www.docker.com) installed. To build the image locally, run the following shell script inside the `k8s-frontend-basic` directory:\n\n```bash\n./docker-build.sh\n```\n\nIf the build completes successfully, you will then be asked if you want to push the image. For this to succeed you will need to be authenticated to the specified registry with the appropriate account.\n\nIf you want to change the fully-qualified image name (including the image registry) edit the `container.json` file within the `public/data` directory.\n\n⚠️ You should not edit the `docker-build.sh` file directly.\n\n\nThis is because the `container.json` file is used by both the Docker build script and the Next.js application at run time.\n\n\n* `registry` and `namespace` are _optional_\n  * Note that the values should not end with a trailing slash\n* `repository` and `tags` are _mandatory_\n  * `tags` is an array that should contain at least one value\n\n```json\n{\n  \"image\": {\n    \"registry\": \"docker.io\",\n    \"namespace\": \"trainingdemos\",\n    \"repository\": \"k8s-frontend-basic\",\n    \"tags\": [\n      \"latest\", \"1.0\", \"1.0.2\"\n    ]\n  }\n}\n```\n## Running in Docker\n\nA container image for this project has been made available on the [Docker Hub](https://hub.docker.com/r/trainingdemos/k8s-frontend-basic) for public use. To run the image using Docker you can use the following command:\n\n```bash\ndocker run --rm -p 80:80 trainingdemos/k8s-frontend-basic\n```\n\nThis will start an Nginx web server running on port `80` to serve the application. You can verify that the website is working by visiting [http://localhost](http://localhost) in a web browser.\n\n## Deploying to Kubernetes\n\nThe `containerPort` in the Pod spec should be set to port `80` and then access to the Pod should be opened up using a Service object along with a NodePort or Ingress.\n\nHere is an example Pod object configuration:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: k8s-frontend-basic\n  labels:\n    frontend: basic\nspec:\n  containers:\n  - name: k8s-basic-frontend\n    image: trainingdemos/k8s-frontend-basic:latest\n    ports:\n    - containerPort: 80\n```\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/) (See LICENSE file)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrainingdemos%2Fk8s-frontend-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrainingdemos%2Fk8s-frontend-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrainingdemos%2Fk8s-frontend-basic/lists"}