FROM python:3.9-slim # Install git and other dependencies RUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/* # Clone the repository RUN git clone https://github.com/clusterofstars-sg/TinyHackathon.git /app # Set working directory WORKDIR /app # Create a non-root user to run the application RUN useradd -m appuser RUN chown -R appuser:appuser /app # Install uv using pip and ensure it's in PATH RUN pip install uv RUN which uv # Set environment variable for uv to use a writable directory ENV UV_CACHE_DIR=/app/.cache/uv # Create and set permissions for the cache directory RUN mkdir -p /app/.cache/uv RUN chown -R appuser:appuser /app/.cache # Switch to the non-root user USER appuser RUN python -m uv sync --no-dev --frozen # Expose port 8001 EXPOSE 8001 # Command to run the application using the full path to uv CMD ["python", "-m", "uv", "run", "tinyhackathon/score_explorer/run.py"]