### Docker Compose Example for Spotweb Source: https://github.com/jgeusebroek/docker-spotweb/blob/master/README.md This is an example of a docker-compose.yml file for setting up Spotweb. After the initial run, you need to remove the dbsettings.inc.php file to proceed with the installation. ```yaml version: '3' services: spotweb: image: jgeusebroek/spotweb container_name: spotweb ports: - "8080:80" environment: - TZ=Europe/Amsterdam - SPOTWEB_DB_TYPE=pdo_mysql - SPOTWEB_DB_HOST=db - SPOTWEB_DB_NAME=spotweb - SPOTWEB_DB_USER=spotweb - SPOTWEB_DB_PASS=spotweb volumes: - ./spotweb:/config depends_on: - db db: image: mariadb:10 container_name: spotweb_db environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=spotweb - MYSQL_USER=spotweb - MYSQL_PASSWORD=spotweb volumes: - ./db:/var/lib/mysql ``` -------------------------------- ### Docker Compose Stack Management Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Commands to start the Docker Compose stack and restart Spotweb after initial setup. Remove dbsettings.inc.php to re-run the installer. ```bash # Start the stack docker-compose up -d # Open the installer (first run only — remove dbsettings.inc.php first) rm /srv/spotweb/config/dbsettings.inc.php # Visit http://localhost:81/install.php, complete setup, then restart: docker-compose restart ``` -------------------------------- ### Initial Docker Installation Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Run a temporary container for the initial Spotweb installation. This allows the web installer to activate at install.php for database schema and user creation. Press CTRL+C to stop the container when done. ```bash docker run -it --rm -p 80:80 \ -e TZ='Europe/Amsterdam' \ jgeusebroek/spotweb # Then open http://localhost/install.php in your browser to complete setup. # Press CTRL+C to stop the temporary container when done. ``` -------------------------------- ### Full Environment Variable Configuration Example Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt An example demonstrating all supported environment variables for configuring Spotweb, including timezone, database connection details, cron job schedules, and custom web server ports. ```bash # Full example showing all supported variables docker run --restart=always -d -p 80:80 \ --name=spotweb \ -v /srv/spotweb/config:/config \ \ # Timezone (PHP date.timezone + system TZ) -e TZ='America/New_York' \ \ # Database — all four required for auto-config generation -e SPOTWEB_DB_TYPE=pdo_mysql \ # pdo_mysql or pdo_pgsql -e SPOTWEB_DB_HOST=db.internal \ -e SPOTWEB_DB_PORT=3306 \ # optional; defaults to DB engine default -e SPOTWEB_DB_NAME=spotweb \ -e SPOTWEB_DB_USER=spotweb \ -e SPOTWEB_DB_PASS=s3cr3t \ \ # Cron — standard cron expressions; omit to disable internal cron -e 'SPOTWEB_CRON_RETRIEVE=*/15 * * * *' \ # fetch new spots every 15 min -e 'SPOTWEB_CRON_CACHE_CHECK=10 */1 * * *' \ # sanity-check cache hourly \ # Custom web server port (useful with host networking) -e WEBSERVER_PORT=8080 \ \ jgeusebroek/spotweb ``` -------------------------------- ### Docker Compose Full Stack Deployment Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Deploy Spotweb and a MariaDB database using Docker Compose. Replace with an absolute path. The installer is available at http://localhost:81/install.php after initial setup. ```yaml version: "2.1" services: spotweb: image: jgeusebroek/spotweb container_name: spotweb restart: unless-stopped environment: - TZ=Europe/Amsterdam - SPOTWEB_DB_TYPE=pdo_mysql - SPOTWEB_DB_HOST=spotweb_db - SPOTWEB_DB_PORT=3306 - SPOTWEB_DB_NAME=spotweb - SPOTWEB_DB_USER=spotweb - SPOTWEB_DB_PASS=spotweb - "SPOTWEB_CRON_RETRIEVE=*/15 * * * *" depends_on: - spotweb_db ports: - 81:80 volumes: - /srv/spotweb/config:/config spotweb_db: image: linuxserver/mariadb container_name: spotwebdb restart: unless-stopped environment: - MYSQL_ROOT_PASSWORD=rootpassword - TZ=Europe/Amsterdam - MYSQL_DATABASE=spotweb - MYSQL_USER=spotweb - MYSQL_PASSWORD=spotweb volumes: - /srv/spotweb/mariadb:/config ports: - 3306:3306 ``` -------------------------------- ### Run Temporary Spotweb Container for Initial Installation Source: https://github.com/jgeusebroek/docker-spotweb/blob/master/README.md Use this command to run a temporary container for the initial Spotweb installation. It maps port 80 and sets the timezone. The database configuration is omitted to trigger the install process. ```bash docker run -it --rm -p 80:80 \ -e TZ='Europe/Amsterdam' \ jgeusebroek/spotweb ``` -------------------------------- ### Permanent Docker Installation Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Start a permanent Spotweb container with persistent storage and database configuration via environment variables. The --restart=always flag ensures the container restarts automatically. The UI is available at http://localhost:80. ```bash docker run --restart=always -d -p 80:80 \ --hostname=spotweb \ --name=spotweb \ -v /srv/spotweb/config:/config \ -e TZ='Europe/Amsterdam' \ -e SPOTWEB_DB_TYPE=pdo_mysql \ -e SPOTWEB_DB_HOST=192.168.1.10 \ -e SPOTWEB_DB_PORT=3306 \ -e SPOTWEB_DB_NAME=spotweb \ -e SPOTWEB_DB_USER=spotweb \ -e SPOTWEB_DB_PASS=s3cr3tpassword \ jgeusebroek/spotweb # Spotweb UI is now available at http://localhost:80 ``` -------------------------------- ### Configure Automatic Spot Retrieval within Container Source: https://github.com/jgeusebroek/docker-spotweb/blob/master/README.md Enable automatic spot retrieval from within the container by setting the SPOTWEB_CRON_RETRIEVE environment variable. This example sets the retrieval to run every 15 minutes. ```bash -e 'SPOTWEB_CRON_RETRIEVE=*/15 * * * *' ``` -------------------------------- ### Configure Apache Virtual Host for Spotweb Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt This Apache configuration serves Spotweb and enables URL rewriting for the Newznab API and spot detail pages. Ensure PHP settings like post_max_size and upload_max_filesize are appropriately configured. ```apache ServerTokens Prod Header set X-Frame-Options: "sameorigin" Header always set X-XSS-Protection "1; mode=block" DocumentRoot /var/www/spotweb RewriteEngine on # Newznab API endpoint RewriteCond %{REQUEST_URI} !api/ RewriteRule api/?$ index.php?page=newznabapi [QSA] # Spot detail pages RewriteRule details/([^/]+) index.php?page=getspot&messageid=$1 [L] Options -Indexes +FollowSymLinks +MultiViews AllowOverride All php_admin_value post_max_size 10M php_admin_value upload_max_filesize 10M ``` -------------------------------- ### Schedule Automatic Spot Retrieval on Docker Host Source: https://github.com/jgeusebroek/docker-spotweb/blob/master/README.md Set up a cron job on the Docker host to execute the Spotweb retrieval script every 15 minutes. This ensures new spots are fetched regularly. ```bash */15 * * * * docker exec spotweb su -l www-data -s /usr/bin/php /var/www/spotweb/retrieve.php >/dev/null 2>&1 ``` -------------------------------- ### Run Permanent Spotweb Container Source: https://github.com/jgeusebroek/docker-spotweb/blob/master/README.md This command runs the Spotweb container persistently. It includes restart policies, port mapping, hostname, volume for configuration persistence, timezone, and database connection details via environment variables. ```bash docker run --restart=always -d -p 80:80 \ --hostname=spotweb \ --name=spotweb \ -v :/config \ -e 'TZ=Europe/Amsterdam' \ -e 'SPOTWEB_DB_TYPE=pdo_mysql' \ -e 'SPOTWEB_DB_HOST=' \ -e 'SPOTWEB_DB_PORT=' \ -e 'SPOTWEB_DB_NAME=spotweb' \ -e 'SPOTWEB_DB_USER=spotweb' \ -e 'SPOTWEB_DB_PASS=spotweb' \ jgeusebroek/spotweb ``` -------------------------------- ### Append Caching and Compression Directives Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Append these directives to Spotweb's .htaccess file to enable browser-side caching and gzip compression. This improves loading times by leveraging mod_expires and mod_deflate. ```apache ExpiresActive On ExpiresDefault "access plus 4 hours" ExpiresByType text/css A900 # 15 minutes ExpiresByType application/javascript A900 ExpiresByType image/png A14400 # 4 hours ExpiresByType image/jpeg A14400 AddOutputFilterByType DEFLATE text/html text/css text/plain AddOutputFilterByType DEFLATE application/javascript application/xml AddOutputFilterByType DEFLATE application/rss+xml application/xhtml+xml ``` -------------------------------- ### Schedule Spotweb Article Retrieval Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Add this cron job to your Docker host's crontab to automatically retrieve articles every 15 minutes. Verify the job runs correctly by manually triggering it. ```bash */15 * * * * docker exec spotweb su -l www-data -s /usr/bin/php /var/www/spotweb/retrieve.php >/dev/null 2>&1 ``` ```bash docker exec spotweb su -l www-data -s /usr/bin/php /var/www/spotweb/retrieve.php ``` -------------------------------- ### Manually Pull Docker Spotweb Images Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt Use these commands to manually pull the latest Spotweb Docker image or a specific dated snapshot from Docker Hub. ```bash # Pull the latest image manually docker pull jgeusebroek/spotweb:latest # Pull a specific dated snapshot docker pull jgeusebroek/spotweb:20240601 ``` -------------------------------- ### GitHub Actions Workflow for Docker Image Builds Source: https://context7.com/jgeusebroek/docker-spotweb/llms.txt This GitHub Actions workflow automates the building and pushing of multi-architecture Docker images weekly and on every push to master. Images are tagged with a date stamp and 'latest'. ```yaml - name: Generate date tag run: echo "DATE_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV - name: Build and push uses: docker/build-push-action@v3 with: platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 push: true tags: | jgeusebroek/spotweb:${{ env.DATE_TAG }} # e.g. jgeusebroek/spotweb:20240601 jgeusebroek/spotweb:latest ghcr.io/jgeusebroek/spotweb:${{ env.DATE_TAG }} ghcr.io/jgeusebroek/spotweb:latest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.