medical_chatbot / Dockerfile
nadeen-elsayed's picture
Update Dockerfile
6762215 verified
raw
history blame contribute delete
794 Bytes
# Use a lightweight Python image
FROM python:3.9
# Set the cache directory to an accessible path
ENV HF_HOME=/home/user/.cache/huggingface
# Ensure the directory is created with correct permissions
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
# Create the working directory
WORKDIR /app
# Install Hugging Face CLI
RUN pip install huggingface_hub
# Ensure the directory exists before copying files
RUN mkdir -p /app
# Copy all necessary files
COPY requirements.txt /app/
# Install Python dependencies
RUN pip install --upgrade pip setuptools
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY train.py /app/
COPY api.py /app/
COPY medical_dataset.json /app/
# Expose port for API
EXPOSE 7860
# Set the default command to start training
CMD ["python", "/app/train.py"]