FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY modbus.py .
ENV TCP_PORT=8181 MODE=stream LOG_MODE=both
ENV CTRL_HOST=0.0.0.0 CTRL_PORT=8182
EXPOSE 8181 8182
CMD ["python","modbus.py"]