> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Git Repositories Dockerfile and Application Walkthrough

> Overview of demo linking GitOps and application repositories, Dockerfile, and CI pipeline showing ArgoCD deployment of a PHP app built and pushed by Jenkins

In this lesson we’ll review the source code and Git repositories used in the demo. You’ll see how the GitOps repo (ArgoCD) holds Kubernetes manifests, while the application repo contains the PHP app, images, Dockerfile, and CI scripts. This walkthrough shows how the repositories, Dockerfile, and manifests fit together in a GitOps + CI/CD workflow.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/fW4IJbgPafxNE8SJ/images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/demo-git-repositories-application-walkthrough.jpg?fit=max&auto=format&n=fW4IJbgPafxNE8SJ&q=85&s=d829b9caff9dd1380c730391b3102210" alt="A presentation slide reading &#x22;Demo — Git Repositories and Application Walkthrough&#x22; with the title shown in purple blocks on the left and a large white card with a small teal film camera icon on the right." width="1920" height="1080" data-path="images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/demo-git-repositories-application-walkthrough.jpg" />
</Frame>

## Overview: Repositories used in the demo

The setup uses two Git repositories hosted in Gitea:

* A GitOps repository (ArgoCD) that contains Kubernetes manifests (Deployment and Service) used by ArgoCD to create resources in the cluster.
* An application repository (Solar System) that contains the PHP application source, static assets, a Dockerfile, and CI scripts used by the Jenkins pipeline.

Quick summary:

| Repository | Purpose | Key files |
| -: | - | - |
| ArgoCD (GitOps) | Store desired Kubernetes objects for ArgoCD to apply to the cluster | `Jenkins-demo/deployment.yaml`, `Jenkins-demo/service.yaml` |
| Solar System (application) | Contain the PHP web app, images, Dockerfile and CI scripts used to build container images | `index.php`, `images/`, `Dockerfile`, `Jenkinsfile`, `pr.sh` |

Open the ArgoCD/GitOps repository to inspect the manifests. In the `Jenkins-demo` directory you’ll find Kubernetes manifests such as `deployment.yaml` and `service.yaml`. ArgoCD continuously monitors this repository and applies detected changes to the cluster (via periodic polling or webhook-driven refresh).

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/fW4IJbgPafxNE8SJ/images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/gitea-repo-file-listing-deployment-service.jpg?fit=max&auto=format&n=fW4IJbgPafxNE8SJ&q=85&s=4bed5b0605b16163a4382d771c69fb67" alt="A dark-themed code hosting repository page (looks like Gitea) showing commit/branch info and a file listing. Visible files include deployment.yaml and service.yaml, with buttons for New File, Upload File and history." width="1920" height="1080" data-path="images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/gitea-repo-file-listing-deployment-service.jpg" />
</Frame>

## Application repository: Solar System (PHP)

The Solar System repository contains a small PHP + HTML web application. Key parts include:

* `index.php` — the single-page app that references images and CSS-like styles.
* `images/` — PNG assets such as `solar-system-9.png` and `background.png`.
* `Dockerfile` — builds the container image from the official PHP Apache base.
* `Jenkinsfile` and `pr.sh` — CI pipeline scripts used by Jenkins to build and push images, and to trigger deployments.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/fW4IJbgPafxNE8SJ/images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/gitea-siddharth-solar-system-repo.jpg?fit=max&auto=format&n=fW4IJbgPafxNE8SJ&q=85&s=fdd768cde0ddbfa4140bfd8c1bbc7c09" alt="A dark-themed Gitea repository page for &#x22;siddharth/solar-system&#x22; showing a Simple PHP app (63 commits, 1 branch, ~13 MiB) and a visible HTTP clone URL. The file list and recent commits are shown, including images, Dockerfile, Jenkinsfile, index.php and pr.sh." width="1920" height="1080" data-path="images/GitOps-with-ArgoCD/ArgoCD-with-Jenkins-CI-Pipeline/Git-Repositories-Dockerfile-and-Application-Walkthrough/gitea-siddharth-solar-system-repo.jpg" />
</Frame>

### index.php — how the page uses repository images

The page is a compact PHP/HTML file. The most important configurable parts are which solar-system image and which background image are used. The CSS references the repository’s raw file URLs to render both the rotating solar system graphic and the page background. A representative snippet:

```html theme={null}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>

#solar-system {
    background: url("http://139.59.21.103:3000/siddharth/solar-system/raw/branch/main/images/solar-system-9.png") center center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    position: static;
    animation: spin 25s linear infinite;
    width: 50vw;
    height: 50vw;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("http://139.59.21.103:3000/siddharth/solar-system/raw/branch/main/images/background.png");
}

/*
    .shadow {
        animation: rainbow 2s linear infinite;
    } */

</style>
</head>
<body>
```

Notes:

* The CSS uses absolute raw URLs from the Gitea server so the page can load images directly from the repo.
* You can swap the image filenames in these URLs to change visuals without touching the Docker image — useful for rapid UI updates.

### Dockerfile — building the container image

The repo includes a simple Dockerfile that copies the application files into the Apache web root and exposes port 80. This is sufficient for containerizing the PHP app:

```dockerfile theme={null}
FROM php:7.4-apache
COPY index.php /var/www/html/
COPY images /var/www/html/images
EXPOSE 80
```

This Dockerfile:

* Uses the official `php:7.4-apache` base image.
* Copies `index.php` and the `images` directory into `/var/www/html`.
* Exposes port `80` for HTTP traffic.

### CI pipeline files

The repository also contains CI-related files (for example `Jenkinsfile` and `pr.sh`) that Jenkins uses to build and push the container image, run tests, or trigger downstream steps such as updating the GitOps repository. In a typical pipeline:

1. Jenkins pulls the application repo.
2. Jenkins builds the Docker image using the `Dockerfile`.
3. The image is pushed to a container registry.
4. GitOps manifests are updated (or a new image tag is written into the ArgoCD repo), and ArgoCD applies the change.

<Callout icon="lightbulb" color="#1CB2FE">
  ArgoCD continuously watches the GitOps repository. Any changes to the manifests will be detected and applied automatically — keep the manifests in the GitOps repo up to date to reflect the desired cluster state.
</Callout>

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/gitops-with-argocd/module/2a9a275c-6019-4953-b2cf-96d9f4c303a8/lesson/402f8046-24df-4e66-b834-08dcbdd2ec38" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.