1
0

42 lines
814 B
Docker
Raw Normal View History

2024-11-22 16:10:38 -05:00
FROM python:3.12-slim
2024-12-30 01:19:50 -05:00
# Create working directory
RUN mkdir -p /app && mkdir /gallery
2024-11-22 16:10:38 -05:00
2024-12-30 01:19:50 -05:00
# Create and set user
RUN useradd -u 1000 -d /app -UM appuser
2024-11-22 16:10:38 -05:00
2024-11-23 01:29:24 -05:00
# Install ffmpeg
RUN apt-get update \
&& apt-get install -y ffmpeg \
&& apt-get clean
2024-12-30 01:19:50 -05:00
# Chown appuser home
RUN chown -R appuser:appuser /app \
&& chown -R appuser:appuser /gallery \
&& chmod 750 /app \
&& chmod 775 /gallery
2024-12-30 01:19:50 -05:00
# Switch to appuser
USER appuser
# Set the working directory
WORKDIR /app
2024-11-22 16:10:38 -05:00
# Ensure pip
RUN python -m ensurepip
# Upgrade pip
RUN pip install --upgrade pip
# Install requirements
2024-12-30 01:19:50 -05:00
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
2024-11-22 16:10:38 -05:00
VOLUME /gallery
2024-11-22 16:10:38 -05:00
# Set the entry point to sort.py
ENTRYPOINT ["python", "/app/sort.py"]