From efe725e3bb252df412afeee97eaf3b4d06f49777 Mon Sep 17 00:00:00 2001 From: Sivaprakash-tech Date: Sat, 10 Jan 2026 18:16:43 +0530 Subject: [PATCH 1/2] Add the .gitignore to exclude Terraform state files --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8ce0778a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Terraform +terraform.tfstate +terraform.tfstate.* +.terraform/ + From cc13154d3ae836badfc74e296a9a6e09e6cc24a5 Mon Sep 17 00:00:00 2001 From: Sivaprakash-tech Date: Sun, 11 Jan 2026 14:29:55 +0530 Subject: [PATCH 2/2] Add backend unit tests and Dockerfile --- backend/Dockerfile | 29 ++++++++++++++++++ backend/requirements.txt | 2 ++ .../test_main.cpython-310-pytest-7.4.3.pyc | Bin 0 -> 1865 bytes backend/tests/test_main.py | 15 +++++++++ 4 files changed, 46 insertions(+) create mode 100644 backend/Dockerfile create mode 100644 backend/tests/__pycache__/test_main.cpython-310-pytest-7.4.3.pyc create mode 100644 backend/tests/test_main.py diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..3a4918018 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,29 @@ +# Stage 1: Build +FROM python:3.11-slim AS builder + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir --upgrade pip \ + && pip install --no-cache-dir -r requirements.txt + +# Stage 2: Run + +FROM python:3.11-slim + +RUN useradd -m appuser + +WORKDIR /app + + +COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11 +COPY --from=builder /usr/local/bin /usr/local/bin + +COPY app ./app + +USER appuser + +EXPOSE 8000 + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] + diff --git a/backend/requirements.txt b/backend/requirements.txt index 212f2fc66..aeee8a106 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -2,3 +2,5 @@ fastapi==0.104.1 uvicorn==0.24.0 pydantic==2.4.2 python-dotenv==1.0.0 +pytest==7.4.3 +httpx==0.25.1 diff --git a/backend/tests/__pycache__/test_main.cpython-310-pytest-7.4.3.pyc b/backend/tests/__pycache__/test_main.cpython-310-pytest-7.4.3.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a166f6ba225923ef6a13f8f44957a780b42a6981 GIT binary patch literal 1865 zcmd6oOLN>r5P)YSt)$hiO&lJTa54`kQ6Rgv*AG%)D&TN+sDjg8RPxTOSFv8q$Ob#o z1#_Y}@B?z#J?=l@H_Vk&{(?_*kF=CHz!_Dk)sNA1?`(gqY;DaWaD9F{iGHJm{E0^U zGQfBSw>$yC2%|9>Q~fj&(;$>2*0@74V#Idhj2*3;v72$si znFG&0qu&wVeFJ-v6Q3&YdoGLPIO1smmKo;x1VgI}OLX8qhFjWDWv5o-9{RB!oyBglnUJmj+JFo$TVv~`tFv{RY~5Bi8?rf-$p{?aTPN4OVVFn5 z84u%P_T~>bpC!FDj*gb}dbIT@zuNVs_o`7gk2X=;_T@kpVR0dYNyfNWZ64KueP1e9 zaG7VRz$NSS8(Oi>${j_$Cs;Z_k8IaxOxZ0 z-gSGQgL>_4*X>b;2r(qnVVZv26kl~c$4r=`?{ga|B{YHpPsJDY@CX%oS z_)mEpreOgQWxbSH>U+Y4!&N;@Rv*Mp+t_OxquQwVI%pf8wU=$TjotRL{kCzqB;qmT zzWsVQ%Mw1!MR*>{+3-2Pe38p1@Drl5Gy!s+eA`4$!^t^M*$@v+Y8fP9ln(MMwV@BP z{HA1R!%R0jAQGziars(rw^# z+VHi8!Vj>n9txKl&Gt}$VW54E#?-<=pfT