opsgenius3 / Dockerfile
YALCINKAYA's picture
set up cache in dockerfile
7c8555b
raw
history blame
717 Bytes
# Use the official Python image
FROM python:3.9-slim
# Set the working directory
WORKDIR /app
# Create a writable cache directory for Hugging Face
RUN mkdir -p /workspace/huggingface_cache && \
chmod -R 777 /workspace/huggingface_cache
# Set environment variable for Hugging Face cache
ENV HF_HOME=/workspace/huggingface_cache
# Copy the requirements file into the image
COPY requirements.txt requirements.txt
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code into the image
COPY . .
# Expose the port your application will run on
EXPOSE 7860
# Command to run your application
CMD ["python", "app.py"]