Spaces:
Running
Running
# Use an official Python runtime as a parent image | |
FROM python:3.12.3-slim | |
# Create the logs directory with appropriate permissions | |
RUN mkdir -p /app/logs && chmod -R 777 /app/logs | |
RUN mkdir -p /tmp/outputs && chmod -R 777 /tmp/outputs # Create /tmp/outputs | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the current directory contents into the container at /app | |
COPY . /app | |
# Install any needed dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Ensure proper permissions for the application | |
RUN chown -R root:root /app | |
RUN chmod -R 777 /app/logs | |
# Expose the port the app runs on | |
EXPOSE 8000 | |
# Run the FastAPI app using Uvicorn | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] | |