File size: 927 Bytes
8cab0fa c616ea8 40e88c4 c616ea8 69a23e0 8cab0fa 40e88c4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
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 --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"] |