forked from TheWicklowWolf/ChannelTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (24 loc) · 799 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.12-alpine
# Set build arguments
ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}
# Create User
ARG UID=1000
ARG GID=1000
RUN addgroup -g $GID general_user && \
adduser -D -u $UID -G general_user -s /bin/sh general_user
# Install ffmpeg
RUN apk update && apk add --no-cache ffmpeg
# Create directories and set permissions
COPY . /channeltube
WORKDIR /channeltube
RUN mkdir -p /channeltube/downloads
RUN mkdir -p /channeltube/audio_downloads
RUN mkdir -p /channeltube/config
RUN chown -R $UID:$GID /channeltube
RUN chmod -R 777 /channeltube
# Install requirements and run code as general_user
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
USER general_user
CMD ["gunicorn","src.ChannelTube:app", "-c", "gunicorn_config.py"]