matdmiller's picture
Fix permissions
c616ea8 verified
raw
history blame
806 Bytes
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
# 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
# Install uv
RUN pip install uv
# Expose port 8001
EXPOSE 8001
# Command to run the application
CMD ["uv", "run", "tinyhackathon/score_explorer/run.py"]