infer / Dockerfile
s-ahal's picture
Update Dockerfile
f9e5baf verified
raw
history blame
599 Bytes
# Create the cache directory and give proper permissions
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Cache folder
ENV HF_HOME=/app/cache
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 7860 (default port for Flask app)
EXPOSE 7860
# Run app.py when the container launches
CMD ["python", "server.py"]