02 β Folder Structure
Your repository must follow this exact layout. The DevOps automation depends on files being in these exact locations.
your-app/
βββ .github/
β βββ workflows/
β βββ ci.yml # Pipeline: builds image, pushes to ECR, deploys to the K8s cluster (required)
βββ dockerfiles/
β βββ Dockerfile # Instructions for packaging your app into a container (required)
β βββ .dockerignore # Files to exclude from the container build (recommended)
βββ kubernetes/
β βββ deployment.yaml # How Kubernetes runs your app β 2 copies minimum (required)
β βββ service.yaml # How Kubernetes routes traffic to your app (required)
β βββ configmap.yaml # Non-sensitive config values (only if needed)
βββ source/
βββ (your app source files) # package.json / requirements.txt / pom.xml live HERE, not at repo root
βββ README.md # Documents every environment variable your app needs (required)
Rules
- The Docker build context is the repository root: builds run as
docker build -f dockerfiles/Dockerfile .β so allCOPYpaths in the Dockerfile are relative to the repo root (e.g.COPY source/package*.json ./), not relative todockerfiles/. - Your dependency manifest (
package.json,requirements.txt, etc.) belongs insidesource/with the rest of the app code. - Extra top-level files are allowed (
README.md,docs/,.gitignore,.env.example) β but the required files must be exactly where shown above. - Do not commit build outputs (
node_modules/,dist/,__pycache__/,target/) β exclude them via.gitignoreanddockerfiles/.dockerignore.
Prompt tip
"Organise the project with this exact folder structure:
.github/workflows/,dockerfiles/,kubernetes/, andsource/. All application code and the dependency manifest go insidesource/. The Docker build context is the repository root."