demo_xray_2 / Dockerfile
Ahmed007's picture
Update Dockerfile
981d587 verified
raw
history blame contribute delete
No virus
854 Bytes
FROM python:3.9
# Create a new user 'user' with user id 1000
RUN useradd -m -u 1000 user
# Set the working directory to /app
WORKDIR /app
# Copy the requirements.txt file into the container at /app/requirements.txt
COPY --chown=user ./requirements.txt requirements.txt
# Install the Python dependencies from requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Install wget to ensure the next RUN command works
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
# Download the model file using wget
RUN wget https://huggingface.co/Ahmed007/chest_xray/resolve/main/model.h5 -O model.h5 && chown user:user model.h5
# Copy the current directory into the container at /app
COPY --chown=user . /app
# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]