add more sort exception handlings

This commit is contained in:
=
2024-12-30 01:19:50 -05:00
parent 1a486ba9d9
commit e78d05f8b4
3 changed files with 49 additions and 14 deletions

View File

@ -1,17 +1,25 @@
FROM python:3.12-slim
# Set the working directory
WORKDIR /app
# Create working directory
RUN mkdir -p /app
# Copy the sort.py file to the working directory
COPY sort.py .
COPY requirements.txt .
# Create and set user
RUN useradd -u 1000 -d /app -UM appuser
# Install ffmpeg
RUN apt-get update \
&& apt-get install -y ffmpeg \
&& apt-get clean
# Chown appuser home
RUN chown -R appuser:appuser /app && chmod 750 /app
# Switch to appuser
USER appuser
# Set the working directory
WORKDIR /app
# Ensure pip
RUN python -m ensurepip
@ -19,7 +27,11 @@ RUN python -m ensurepip
RUN pip install --upgrade pip
# Install requirements
RUN pip install -r requirements.txt
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# Copy the sort.py file to the working directory
COPY sort.py /app/sort.py
# Set the entry point to sort.py
ENTRYPOINT ["python", "/app/sort.py"]