-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d6dbc3
commit 9f4500f
Showing
1 changed file
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
FROM python:3.11-slim | ||
# Create User | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
RUN groupadd -g $GID general_user && \ | ||
useradd -m -u $UID -g $GID -s /bin/bash general_user | ||
RUN umask 0000 | ||
# Install ffmpeg | ||
RUN apt-get update && apt-get install -y \ | ||
ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ffmpeg && \ | ||
rm -rf /var/lib/apt/lists/* | ||
# Create directories and set permissions | ||
COPY . /channeltube | ||
WORKDIR /channeltube | ||
RUN mkdir -p /channeltube/downloads | ||
RUN chown -R $UID:$GID /channeltube | ||
RUN chmod -R 777 /channeltube/downloads | ||
# Install requirements and run code as general_user | ||
RUN pip install -r requirements.txt | ||
EXPOSE 5000 | ||
USER general_user | ||
CMD ["gunicorn","src.ChannelTube:app", "-c", "gunicorn_config.py"] |