File size: 2,247 Bytes
41ca5f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c84578
41ca5f7
 
4784c4c
 
41ca5f7
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Use an official Python runtime as a parent image
FROM python:3.12-slim

# Set the working directory in the container to /app
WORKDIR /app

# Add the current directory contents into the container at /app
ADD . /app

# Install ffmpeg and curl
RUN apt-get update && apt-get install -y ffmpeg curl

# Create a virtual environment and activate it
RUN python -m venv /opt/venv

# Ensure the virtual environment is used
ENV PATH="/opt/venv/bin:$PATH"

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Make port 7680 available to the world outside this container
EXPOSE 5000

# Copy defaults.json from the given URL
COPY ./defaults.linux.json ./defaults.json

# Run setup script commands
RUN curl -o defaults.json https://raw.githubusercontent.com/shubhamakshit/pwdlv3/main/defaults.linux.json && \
    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
    if command -v python &> /dev/null; then \
        echo "Python is installed" && \
        if [[ $(uname -o) != "Android" ]]; then \
            python get-pip.py; \
        fi && \
        python -m pip install -r requirements.txt; \
    elif command -v python3 &> /dev/null; then \
        echo "Python3 is installed" && \
        if [[ $(uname -o) != "Android" ]]; then \
            python3 get-pip.py; \
        fi && \
        python3 -m pip install -r requirements.txt; \
    else \
        echo "Python is not installed" && \
        exit 1; \
    fi && \
    rm get-pip.py && \
    mkdir -p /app/bin && \
    curl -o /app/bin/mp4decrypt https://raw.githubusercontent.com/shubhamakshit/pwdlv3_assets/main/$(uname -o)/$(uname -m)/mp4decrypt && \
    curl -o /app/bin/vsd https://raw.githubusercontent.com/shubhamakshit/pwdlv3_assets/main/$(uname -o)/$(uname -m)/vsd && \
    chmod +x /app/bin/* && \
    if ! grep -q "alias pwdl" ~/.bashrc; then \
        echo "alias pwdl='python3 /app/pwdl.py'" >> ~/.bashrc; \
    fi && \
    echo "Please restart your terminal or run 'source ~/.bashrc' to apply the alias."

# Create webdl directory
RUN mkdir /app/webdl

#set flask app
ENV FLASK_DEBUG=0
ENV FLASK_ENV=development
ENV FLASK_APP=run:app
EXPOSE 7680
ENTRYPOINT ["flask", "run", "--host=0.0.0.0","--port=7680"]