Skip to content

imvickykumar999/24x7-Stream-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiuser Livestream Application

A Docker-based multiuser livestream application that allows users to stream and share video content.

curl -fsSL https://raw.githubusercontent.com/imvickykumar999/24x7-Stream-Docker/main/deploy.sh | bash

Gemini_Generated_Image_kg8j7jkg8j7jkg8j

Explanation of the flags:

  • curl: The tool to fetch the file.
  • -f: Fails silently on server errors (useful if the URL is wrong).
  • -s: Silent mode (no progress meter).
  • -S: Shows an error if it fails (when used with -s).
  • -L: Follows redirects (crucial for GitHub URLs).
  • | bash: Pipes the downloaded script directly into bash to execute it immediately.

Prerequisites

  • Docker installed on your system
  • sudo access for permission management
  • Port 8000 available on your system

Quick Start

1. Pull the Docker Image

docker pull imvickykumar999/multiuser-livestream:latest

2. Create Required Directories

mkdir -p media logs

3. Set Proper Permissions

The application runs as user app (UID 1000) inside the container. Set the correct ownership for the mounted directories:

sudo chown -R 1000:1000 media/ logs/

4. Run the Container

docker run -d --name livestream-app \
  -p 0.0.0.0:8000:8000 \
  -v $(pwd)/media:/app/media \
  -v $(pwd)/logs:/app/logs \
  imvickykumar999/multiuser-livestream:latest

Create Super User

To create a superuser account for Django admin access:

# Create superuser with no interactive prompts
docker exec livestream-app python manage.py createsuperuser --username admin --email admin@example.com --noinput

# Change password for admin
docker exec -it livestream-app python manage.py changepassword admin

Note: The default credentials will be:

After creation, you can access the Django admin at http://localhost:8000/admin/ and log in with these credentials.

5. Verify the Container is Running

docker ps

You should see output similar to:

CONTAINER ID   IMAGE                                         COMMAND                  CREATED         STATUS                   PORTS                    NAMES
97f372be671d   imvickykumar999/multiuser-livestream:latest   "python manage.py ru…"   3 seconds ago   Up 2 seconds (healthy)   0.0.0.0:8000->8000/tcp   livestream-app

Accessing the Application

  • Local Access: http://localhost:8000
  • Network Access: http://YOUR_SERVER_IP:8000
  • External Access: If you have a public IP, the app will be accessible at YOUR_PUBLIC_IP:8000

Directory Structure

After running the container, your directory structure will look like:

/home/Downloads/
├── media/
│   └── videos/          # Uploaded video files
├── logs/                # Application logs
└── README.md           # This file

Container Management

Stop the Container

docker stop livestream-app

Start the Stopped Container

docker start livestream-app

Remove the Container

docker stop livestream-app
docker rm livestream-app

View Logs

docker logs livestream-app

Access Container Shell

docker exec -it livestream-app /bin/bash

Git Automation

A convenient script is provided to automatically add, commit, and push all changes to the repository.

Quick Push All Changes

# Push all changes with auto-generated commit message (includes timestamp)
./git_push_all.sh

# Or provide a custom commit message
./git_push_all.sh "Your custom commit message here"

What the script does:

  1. ✅ Checks if you're in a git repository
  2. 📊 Shows current git status
  3. 📁 Adds all changes (git add .)
  4. 💾 Commits with timestamp or custom message
  5. ⬆️ Pushes to remote main branch
  6. 📅 Displays the commit hash

Note: Make sure the script is executable: chmod +x git_push_all.sh

Troubleshooting

Permission Denied Error

If you see PermissionError: [Errno 13] Permission denied, the mounted directories don't have correct permissions:

sudo chown -R 1000:1000 media/ logs/
docker restart livestream-app

Port Already in Use

If port 8000 is already in use:

# Check what's using port 8000
sudo lsof -i :8000

# Or use a different port
docker run -d --name livestream-app -p 8001:8000 -v $(pwd)/media:/app/media -v $(pwd)/logs:/app/logs imvickykumar999/multiuser-livestream:latest

Container Name Conflict

If you get a name conflict error:

docker rm livestream-app
# Then run the container again

External Access Issues

If you can't access from external IPs:

  1. Ensure your firewall allows port 8000
  2. Check if port forwarding is configured on your router (if accessing from outside your local network)
  3. Verify you're using the correct external IP address

Configuration

The application uses the following default configuration:

  • Port: 8000 (inside container)
  • Media Directory: /app/media (mounted from host ./media)
  • Logs Directory: /app/logs (mounted from host ./logs)
  • User: app (UID 1000)

Support

For issues or questions about the application, please check the Docker logs or container health status.