Spaces:
Sleeping
Sleeping
| FROM openjdk:17-slim | |
| # Install python3, pip, procps, redis-server | |
| RUN apt-get update && \ | |
| apt-get install -y python3 python3-pip procps redis-server && \ | |
| rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy dependencies | |
| COPY requirements.txt . | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # Copy code | |
| COPY . . | |
| # Create runner directory | |
| RUN mkdir -p runner && chmod 700 runner | |
| # Expose FastAPI and Redis ports | |
| EXPOSE 7860 6379 | |
| # Start Redis in background, RQ worker, then FastAPI | |
| CMD redis-server --daemonize yes && \ | |
| rq worker & \ | |
| uvicorn main:app --host 0.0.0.0 --port 7860 --workers 1 | |