diff --git a/backend/Dockerfile b/backend/Dockerfile
index 03f05e37add4af18ca704fed288a9cea4ad4721b..ab8c019d9453fd29a900fcbde029425275ab1958 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -1,7 +1,4 @@
-FROM python:3.10-slim
-
-RUN apt-get update
-RUN apt-get install -y gcc
+FROM python:3.11-slim
 
 ## make a local directory
 RUN mkdir /app
@@ -9,14 +6,15 @@ RUN mkdir /app
 # set "app" as the working directory from which CMD, RUN, ADD references
 WORKDIR /app
 
-# copy requirements.txt to /app
-ADD requirements.txt .
-
-# pip install the local requirements.txt
-RUN pip install -r requirements.txt
+# now copy all the files in this directory to /app
+COPY . .
 
-# now copy all the files in this directory to /code
-ADD . .
+# hadolint ignore=DL3008
+RUN apt-get update \
+  && apt-get install --no-install-recommends -y gcc libffi-dev libc6-dev \
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/* \
+  && pip install --no-cache-dir -r requirements.txt
 
 # Listen to port 80 at runtime
 EXPOSE 5000