Spaces:
Runtime error
Runtime error
File size: 972 Bytes
b44c3a2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# Use Python 3.9 as base image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary directories with proper permissions
RUN mkdir -p /app/uploads \
/app/predictions \
&& chmod -R 777 /app/uploads \
/app/predictions
# Copy the application code and utilities
COPY . /app/
COPY ../voting.py /app/
COPY ../config.py /app/
COPY ../dataset_utils.py /app/
COPY ../label_encoders.pkl /app/
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV PORT=7861
# Expose the port the app runs on
EXPOSE 7861
# Command to run the application
CMD ["python", "app.py"] |