I am looking to create an image of a project that consists of a chatbot model integrated into an API. I create the Dockerfile, launch it, and get this error.
My Dockerfile:
FROM python:3.10-slim
# Add labels for documentation
LABEL maintainer="EPEE EPEE Landry <[email protected]>"
LABEL description="Chatbot API using FastAPI"
# Creating a non-root user
RUN useradd -m -u 1000 appuser
WORKDIR /app
COPY requirements.txt .
# Install packages in specific order to resolve conflicts
RUN pip install --no-cache-dir typing-extensions==4.5.0 && \
pip install --no-cache-dir torch==2.2.0 && \
pip install --no-cache-dir -r requirements.txt
COPY . .
# Change permissions for non-root user
RUN chown -R appuser:appuser /app
# Using non-root user
USER appuser
EXPOSE 8000
CMD ["uvicorn", "hf_model:app", "--host", "0.0.0.0", "--port", "8000"]
The error message
ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir typing-extensions==4.5.0 && pip install --no-cache-dir tensorflow-cpu==2.13.0 && pip install --no-cache-dir torch==2.2.0 && pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1
What I tried:
- Specified a specific version of each library to avoid incompatibility problem
- Run some library saparately to the requirements.txt
Question:
- How can I erase that problem?