adjust
Some checks failed
Docker Deploy / build-and-deploy (push) Failing after 35s

This commit is contained in:
sam
2026-02-06 17:25:41 +00:00
parent 5ef1b588ef
commit a0ed0b4a4d
2 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,54 @@
name: Docker Deploy
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build -t my-jiodown-app:latest .
# - name: Remove Old Container
# run: |
# # Use '|| true' to force a success exit code even if the container is missing
# docker stop my-running-app || true
# docker rm my-running-app || true
- name: Remove Old Container and Free Port
run: |
# 1. Stop and remove by NAME (what we had before)
docker stop my-jiodown-app || true
docker rm my-jiodown-app || true
# 2. EMERGENCY: Stop any container actually using port 9002
# This finds the ID of any container bound to 9002 and kills it
PORT_OWNER=$(docker ps -q --filter "publish=8501")
if [ ! -z "$PORT_OWNER" ]; then
docker stop $PORT_OWNER
docker rm $PORT_OWNER
fi
- name: Start New Container
run: |
docker run -d \
--name my-jiodown-app \
-p 8501:8501 \
-v /path/on/your/host:/usr/share/nginx/html \
--restart unless-stopped \
Jiodown:latest
# - name: Deploy to CasaOS (Docker)
# run: |
# # Stop and remove the old container if it exists
# docker stop my-running-app || true
# docker rm my-running-app || true
# # Run the new container
# docker run -d \
# --name my-running-app \
# -p 9002:5005 \
# --restart always \
# my-local-app:latest

4
app.py
View File

@@ -20,7 +20,7 @@ DOWNLOAD_DIR = os.path.join(os.getcwd(), "downloads")
if not os.path.exists(DOWNLOAD_DIR): if not os.path.exists(DOWNLOAD_DIR):
os.makedirs(DOWNLOAD_DIR) os.makedirs(DOWNLOAD_DIR)
st.set_page_config(page_title="JioSaavn Pro Downloader", page_icon="🎵", layout="wide") st.set_page_config(page_title="JioSaavn Downloader", page_icon="🎵", layout="wide")
# --- SESSION STATE SETUP --- # --- SESSION STATE SETUP ---
if 'search_results' not in st.session_state: if 'search_results' not in st.session_state:
@@ -243,7 +243,7 @@ def process_jiosaavn_link(url):
return None, None return None, None
# --- UI LOGIC --- # --- UI LOGIC ---
st.title("🎵 JioSaavn Multi-Downloader") st.title("🎵 JioSaavn Downloader")
# 1. Search / Link Input Section # 1. Search / Link Input Section
with st.container(): with st.container():