CoolFace
Apppublic

Elevatics/code-chat-api

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
Dockerfile29 linesDownload Raw Back to root
1# Use an official Python runtime as a parent image2FROM python:3.10.93 4# Set the working directory in the container 5WORKDIR /app6 7COPY requirements.txt /app8 9# Install any needed packages specified in requirements.txt10RUN pip install --no-cache-dir -r requirements.txt11 12# Create a non-root user13RUN useradd -m appuser14 15# Create necessary directories and set permissions16RUN mkdir -p /app/data /app/indexes /tmp/app-work /data && \17    chmod -R 777 /app && \18    chmod -R 777 /tmp/app-work && \19    chmod -R 777 /data && \20    chown -R appuser:appuser /app /tmp/app-work /data21 22# Switch to the non-root user23USER appuser24 25# Copy the current directory contents into the container at /app26COPY . /app27 28# Start the FastAPI app on port 7860, the default port expected by Spaces29CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]