add more sort exception handlings
This commit is contained in:
@ -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"]
|
Reference in New Issue
Block a user