urban-change-detector / Dockerfile
Amrender's picture
Create Dockerfile
13a5195 verified
raw
history blame contribute delete
576 Bytes
# Use a lightweight Python base image
FROM python:3.10-slim
# Set up a non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy the requirements file and install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the actual application code
COPY --chown=user app.py .
# Expose the standard Space port
EXPOSE 7860
# Boot up the FastAPI server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]