From c37a0e12e408c3298cdca1eaa28d8ebc5a40bfb9 Mon Sep 17 00:00:00 2001
From: KADDOUR Sidi Mohammed <sidi-mohammed.kaddour@inria.fr>
Date: Fri, 20 Dec 2024 14:17:44 +0100
Subject: [PATCH] updated dockerfiles

---
 services/motion_detector/Dockerfile   | 21 +++++++++++----------
 services/object_recognizer/Dockerfile |  5 ++++-
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/services/motion_detector/Dockerfile b/services/motion_detector/Dockerfile
index 4f19877..db892de 100644
--- a/services/motion_detector/Dockerfile
+++ b/services/motion_detector/Dockerfile
@@ -1,25 +1,26 @@
-# Dockerfile for server microservice
-
 # Use the official Python image as base
-FROM --platform=linux/arm64 python:3.8-slim as build
+FROM python:3.8-slim as build
 
 # Set the working directory inside the container
 WORKDIR /app
 
+# Install system-level dependencies (if required for Python packages)
+RUN apt-get update && apt-get install -y build-essential
+
 # Copy the server code into the container
 COPY . .
 
 # Install required Python packages
-RUN pip install -r requirements.txt
+RUN pip install --no-cache-dir -r requirements.txt
 
 # Set environment variables
-ENV OR_HOST_IP=localhost
-ENV OR_PORT=9999
-ENV LOG_LEVEL=INFO
-ENV TZ=UTC
+ENV OR_HOST_IP=localhost \
+    OR_PORT=9999 \
+    LOG_LEVEL=INFO \
+    TZ=UTC
 
-# Expose the port used by the server (if needed)
-# EXPOSE <port_number>
+# Expose the port used by the server
+EXPOSE 9999
 
 # Command to run the server code
 CMD ["python", "src/motion_detection.py"]
diff --git a/services/object_recognizer/Dockerfile b/services/object_recognizer/Dockerfile
index 62fd939..d8d518a 100644
--- a/services/object_recognizer/Dockerfile
+++ b/services/object_recognizer/Dockerfile
@@ -1,9 +1,12 @@
 # Use the official Python image as base
-FROM --platform=linux/arm64 python:3.8-slim as build
+FROM python:3.8-slim as build
 
 # Set the working directory inside the container
 WORKDIR /app
 
+# Install system dependencies for Python packages (if needed)
+RUN apt-get update && apt-get install -y build-essential
+
 # Copy the server code into the container
 COPY . .
 
-- 
GitLab