Spaces:
Sleeping
Sleeping
Upload Dockerfile with huggingface_hub
Browse files123456789101112131415161718192021# Use a lightweight Python base imageFROM python:3.9-slim-buster# Set the working directory in the containerWORKDIR /app# Copy the requirements file into the containerCOPY backend_files/requirements.txt .# Install the Python dependenciesRUN pip install --no-cache-dir -r requirements.txt# Copy the application code and the trained model into the containerCOPY backend_files/app.py .COPY tuned_random_forest_model.joblib .# Expose the port that the Flask app will run onEXPOSE 5000# Define the command to run the Flask application using gunicornCMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "app:predict_sales_api"]12345678910111213141516# Use a minimal base image with Python 3.9 installedFROM python:3.9-slim# Set the working directory inside the container to /appWORKDIR /app# Copy all files from the current directory on the host to the container's /app directoryCOPY . .# Install Python dependencies listed in requirements.txtRUN pip3 install -r requirements.txt# Define the command to run the Streamlit app on port 8501 and make it accessible externallyCMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]# NOTE: Disable XSRF protection for easier external access in order to make batch predictions
Dockerfile+10-15