{"id":19111108,"url":"https://github.com/jonathanxdr/m347","last_synced_at":"2026-03-19T08:10:35.243Z","repository":{"id":118718598,"uuid":"608653174","full_name":"JonathanXDR/M347","owner":"JonathanXDR","description":"Dienst mit Container anwenden","archived":false,"fork":false,"pushed_at":"2024-07-23T22:29:35.000Z","size":776,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T22:14:14.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"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/JonathanXDR.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":"2023-03-02T13:18:49.000Z","updated_at":"2024-04-25T21:48:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a3f30cb-34c5-43c3-883d-1392cbacb9da","html_url":"https://github.com/JonathanXDR/M347","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/JonathanXDR%2FM347","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanXDR%2FM347/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanXDR%2FM347/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanXDR%2FM347/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonathanXDR","download_url":"https://codeload.github.com/JonathanXDR/M347/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240165255,"owners_count":19758344,"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":[],"created_at":"2024-11-09T04:27:07.197Z","updated_at":"2026-03-19T08:10:30.213Z","avatar_url":"https://github.com/JonathanXDR.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# M347\n\nWelcome to M347-Portfolio, a ToDo application built using Docker and Kubernetes. This README provides documentation on how to set up, manage, and debug the application. The application consists of a frontend, backend, and a MariaDB database.\n\n## Table of Contents\n\n- [M347-Portfolio](#m347-portfolio)\n  - [Table of Contents](#table-of-contents)\n  - [Prerequisites](#prerequisites)\n  - [Getting Started](#getting-started)\n  - [Using Docker](#using-docker)\n    - [Build Images](#build-images)\n    - [Manage Containers (Docker Compose)](#manage-containers-docker-compose)\n    - [Debugging](#debugging)\n  - [Using Kubernetes](#using-kubernetes)\n    - [Manage Resources](#manage-resources)\n    - [Debugging](#debugging-1)\n  - [Additional Information](#additional-information)\n    - [Environment Variables](#environment-variables)\n    - [GitHub Actions](#github-actions)\n\n## Prerequisites\n\nBefore you begin, ensure you have the following tools \u0026 services installed on your local machine:\n\n- [Docker](https://docs.docker.com/get-docker/) - Used for running and building the application.\n- [Kubernetes (Kubectl)](https://kubernetes.io/docs/tasks/tools/) - Used for managing the application in a Kubernetes cluster (Local or Cloud).\n- [Minikube](https://minikube.sigs.k8s.io/docs/start/) - Used for running a local Kubernetes cluster.\n\n## Getting Started\n\n## Using Docker\n\n### Build Images\n\nNormally, the Docker images for the frontend and backend are built using [GitHub Actions](#github-actions), when pushing a commit to the `main` branch. However, you can also build the Docker images locally using the following commands:\n\n```bash\ndocker build -t \u003cfrontend or backend\u003e ./\u003cFrontend or Backend\u003e\n```\n\n### Manage Containers (Docker Compose)\n\nFor running the application locally quickly, you can use Docker Compose. This will create \u0026 run the Docker containers for the frontend, backend, and MariaDB database. To start the application, run the following command:\n\n```bash\ndocker-compose up -d\n```\n\nTo stop the application, run the following command:\n\n```bash\ndocker-compose down\n```\n\n### Debugging\n\nHere are some useful docker commands for debugging:\n\n```bash\n# 1. List all running containers, including their IDs, names, and statuses.\ndocker ps\n\n# 2. Show the logs of a specific container, which can help you find error messages or trace the application's execution.\ndocker logs \u003ccontainer-id/name\u003e\n\n# 3. Execute a command inside a running container, such as running a shell (`/bin/bash` or `/bin/sh`) to investigate the container's file system and processes.\ndocker exec -it \u003ccontainer-id/name\u003e \u003ccommand\u003e\n\n# 4. Provide detailed information about a container, including its configuration, network settings, and mounted volumes.\ndocker inspect \u003ccontainer-id/name\u003e\n\n# 5. Display real-time performance statistics for all running containers, including CPU usage, memory consumption, and network I/O.\ndocker stats\n\n# 6. Show the running processes inside a container, similar to the `top` command on Linux.\ndocker top \u003ccontainer-id/name\u003e\n\n# 7. List the file system changes made in a container compared to the base image.\ndocker diff \u003ccontainer-id/name\u003e\n\n# 8. Copy files or directories between a container and the local file system, which can be helpful for examining application data or configuration files.\ndocker cp \u003ccontainer-id/name\u003e:\u003cpath/to/source\u003e \u003cpath/to/destination\u003e\n\n# 9. If you are using Docker Compose, show the logs for all services defined in the `docker-compose.yml` file.\ndocker-compose logs\n\n#10. Tear down the current services and rebuild the containers from scratch if you've made changes to your application's code or dependencies.\ndocker-compose down \u0026\u0026 docker-compose up --build\n```\n\n## Using Kubernetes\n\nFor running the application locally, you can use Minikube. This will create the Kubernetes cluster. To start Minikube, run the following command:\n\n```bash\nminikube start\n```\n\nTo stop Minikube again, run:\n\n```bash\nminikube stop\n```\n\n### Manage Resources\n\nAfter the Kubernetes cluster was created, you can apply the Kubernetes resources for the application using the following commands.\n\n```bash\nkubectl apply -f .\n```\n\nTo delete the Kubernetes resources, use the `delete` keyword instead of `apply`.\n\n### Debugging\n\nHere are some useful kubectl commands for debugging:\n\n```bash\n# 1. Get information about all resources in the cluster (e.g., pods, services, deployments)\nkubectl get \u003cresource-type\u003e\n\n# 2. Describe a specific resource in detail\nkubectl describe \u003cresource-type\u003e \u003cresource-name\u003e\n\n# 3. Get logs from a specific pod\nkubectl logs \u003cpod-name\u003e\n\n# 4. Stream logs from a specific pod in real-time\nkubectl logs -f \u003cpod-name\u003e\n\n# 5. Get the current state of a Kubernetes configuration\nkubectl config view\n\n# 6. Switch between different Kubernetes contexts\nkubectl config use-context \u003ccontext-name\u003e\n\n# 7. Execute a command within a specific pod\nkubectl exec -it \u003cpod-name\u003e -- \u003ccommand\u003e\n\n# 8. Get the current status of a specific deployment\nkubectl rollout status deployment/\u003cdeployment-name\u003e\n\n# 9. Display the history of a specific deployment\nkubectl rollout history deployment/\u003cdeployment-name\u003e\n\n# 10. Get resource usage information for each pod in the namespace\nkubectl top pod\n\n# 11. Get resource usage information for each node in the cluster\nkubectl top node\n\n# 12. Debug issues with ingress by displaying ingress resources\nkubectl get ingress\n\n```\n\n## Additional Information\n\n### Environment Variables\n\nThe application uses the following environment variables:\n\n```bash\nDB_HOST # The hostname of the MariaDB database server.\nDB_USER # The username to use for connecting to the MariaDB database.\nDB_PASSWORD # The password to use for connecting to the MariaDB database.\nDB_NAME # The name of the MariaDB database to use.\n```\n\nThese environment variables can be set in the respective Docker and Kubernetes configuration files.\n\n### GitHub Actions\n\n`publish.yml`, is responsible for building and publishing Docker images for the frontend and backend components of the application. The action is triggered on each push to the repository.\n\nThe `publish.yml` file is composed of two jobs: `publish-frontend-image` and `publish-backend-image`. Both jobs have similar steps:\n\n1. Check out the repository using the `actions/checkout@v2` action.\n2. Log in to the GitHub Container Registry using the `docker/login-action@v1` action, with the `GHCR_PAT` secret for authentication.\n3. Build the Docker image for either the frontend or backend, tagging it with the appropriate path in the GitHub Container Registry (e.g., `ghcr.io/jonathanxdr/todo-frontend:latest` or `ghcr.io/jonathanxdr/todo-backend:latest`).\n4. Push the built image to the GitHub Container Registry.\n\nThis GitHub Action allows for automated building and publishing of the Docker images, ensuring that the latest versions are always available in the GitHub Container Registry.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanxdr%2Fm347","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanxdr%2Fm347","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanxdr%2Fm347/lists"}