flowardΒ·vibes
Home / 02 β€” Folder Structure 1 min read

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 all COPY paths in the Dockerfile are relative to the repo root (e.g. COPY source/package*.json ./), not relative to dockerfiles/.
  • Your dependency manifest (package.json, requirements.txt, etc.) belongs inside source/ 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 .gitignore and dockerfiles/.dockerignore.

Prompt tip

"Organise the project with this exact folder structure: .github/workflows/, dockerfiles/, kubernetes/, and source/. All application code and the dependency manifest go inside source/. The Docker build context is the repository root."