# Use a slim version of Python 3.10 as the base image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Install system dependencies required for compiling protobufs
RUN apt-get update && apt-get install -y --no-install-recommends \
    protobuf-compiler \
    && rm -rf /var/lib/apt/lists/*

# Copy the requirements file into the container
COPY sim_devices/requirements.txt .

# Install Python dependencies from the requirements file
RUN pip install --no-cache-dir -r requirements.txt

# Copy utils (shared modules)
COPY utils/ ./utils/

# Copy the rest of your application's source code
COPY sim_devices/src/ .

# Run the device simulators
CMD ["python", "device_simulators.py"]