docker installation - panuozzo77/StreamingCommunity GitHub Wiki
This guide explains how to set up and run the StreamingCommunity application using Docker, providing an isolated and consistent environment across different platforms.
Before proceeding with the Docker installation, ensure you have:
-
Docker: Installed and running on your system
- Install Docker Desktop for Windows/macOS
- Install Docker Engine for Linux
- Verify installation with:
docker --version
-
Make (optional): For using the quick setup commands in the Makefile
- Windows: Install via Chocolatey:
choco install make
- macOS: Included with Xcode Command Line Tools
- Linux: Install via package manager (e.g.,
sudo apt install make
)
- Windows: Install via Chocolatey:
You can either clone the repository using Git or download it as a ZIP file.
git clone https://github.com/Arrowar/StreamingCommunity.git
cd StreamingCommunity
- Go to https://github.com/Arrowar/StreamingCommunity
- Click the "Code" button and select "Download ZIP"
- Extract the ZIP file to your desired location
- Navigate to the extracted directory
From the StreamingCommunity directory, build the Docker image:
docker build -t streaming-community-api .
This command builds a Docker image named streaming-community-api
using the Dockerfile in the current directory. The build process may take several minutes depending on your internet connection and system performance.
To run StreamingCommunity in a Docker container:
docker run -it -p 8000:8000 streaming-community-api
This command:
-
-it
: Runs the container in interactive mode with a pseudo-TTY -
-p 8000:8000
: Maps port 8000 from the container to port 8000 on your host -
streaming-community-api
: Uses the image we built earlier
By default, videos will be saved in /app/Video
inside the container. To save them on your host machine instead:
docker run -it -p 8000:8000 -v /path/to/download:/app/Video streaming-community-api
Replace /path/to/download
with the absolute path to your desired download directory on your host machine.
If you have make
installed, you can use the commands configured in the Makefile:
# Build the container
make build-container
# Run the container with a custom download directory
make LOCAL_DIR=/path/to/download run-container
The run-container
command also mounts the config.json
file, so any changes to the configuration file are reflected immediately without having to rebuild the image.
For a more persistent setup, you can use Docker Compose. Create a file named docker-compose.yml
with the following content:
version: '3'
services:
streamingcommunity:
build: .
ports:
- "8000:8000"
volumes:
- ./config.json:/app/config.json
- /path/to/download:/app/Video
restart: unless-stopped
Then run:
docker-compose up -d
To stop the container:
docker-compose down
To use a custom configuration file:
docker run -it -p 8000:8000 -v /path/to/your/config.json:/app/config.json streaming-community-api
To access the shell inside the running container:
# First, find the container ID
docker ps
# Then access the shell
docker exec -it CONTAINER_ID /bin/bash
Replace CONTAINER_ID
with the actual ID of your running container.
-
Permission Denied for Volumes
- Ensure the host directory has appropriate permissions
- On Linux, you might need to adjust SELinux settings:
sudo chcon -Rt svirt_sandbox_file_t /path/to/download
-
Port Already in Use
- Change the host port mapping:
-p 8001:8000
- Change the host port mapping:
-
Container Exits Immediately
- Check logs with:
docker logs CONTAINER_ID
- Ensure the container is run with the
-it
flag for interactive mode
- Check logs with:
-
Network Issues Inside Container
- Verify your Docker network settings
- Try using the
--network host
option (Linux only)
If you encounter issues not covered here:
- Check the Common Issues section
- Visit the GitHub Issues page
- Join the Discord community for support
- Configure your settings
- Learn about command line arguments
- Try your first global search