Giter VIP home page Giter VIP logo

docker-spotweb's Introduction

Dockerfile to set up Spotweb on x86 and arm based systems

The main goal of this Dockerfile is to easily set up Spotweb using Docker on the Raspberry Pi (or any compatible arm chipset) and regular x86 chipsets.

Quick setup

Spotweb always requires a database server (e.g. MySQL), the easiest solution is to use the docker-compose setup. The other option is to manually specify an external database server using the ENV variables below.

Provide one or more of the following environment variables to configure the database server (all optional, default values are given below):

  • TZ (default = Europe/Amsterdam)
  • DB_ENGINE (default = pdo_mysql)
  • DB_HOST (default = mysql)
  • DB_PORT (default = 3306)
  • DB_NAME (default = spotweb)
  • DB_USER (default = spotweb)
  • DB_PASS (default = spotweb)

E.g. to configure MySQL database server with host some.external.mysql-server.com, port 6612 and timezone Europe/London do the following:

docker run -p 8085:80 \
  --name spotweb -d \
  -e DB_HOST=some.external.mysql-server.com \
  -e DB_PORT=6612 \
  -e TZ=Europe/London \
  erikdevries/spotweb

Instead of using the pre-build image on Docker Hub you can build the image locally, for example:

docker build -t spotweb .

docker run -p 8085:80 \
  --name spotweb -d \
  -e DB_HOST=some.external.mysql-server.com \
  -e DB_PORT=6612 \
  -e TZ=Europe/London \
  spotweb

Quick setup using Docker Compose

Included are example Docker Compose files, modify them as desired (e.g. change the MySQL root password).

  • docker compose up (to use pre-build image from Docker Hub) or docker compose -f docker-compose-local.yml up (to build the image locally)

Configure Spotweb

  • Visit http://localhost:8085
  • Login with username admin and password spotweb
  • Configure usenet server, spot retention, etc. and wait for spots to appear (retrieval script by default runs once every 5 minutes, see below how to change this update interval)

Store cache outside container

  • By default Spotweb store cache (like images) inside of the Docker container (in /app/cache)
  • This results in the cache being removed when the container is recreated (e.g. when a new Docker image is pulled)
  • To retain this cache you can mount a volume to /app/cache see the commented lines in the included Docker Compose files

Change Spotweb update interval

  • By default Spotweb will update every 5 minutes
  • Change the CRON_INTERVAL environment variable to any valid cronjob expression (see e.g. https://cron.help/ for more information, default 5 minute interval is configured in the docker-compose.yml file as an example)
  • Restart the Spotweb Docker container (during start-up it will display the current configured update interval)

Change timezone

  • Change the TZ environment variable to any valid timezone (e.g. Europe/Amsterdam or Europe/Lisbon)
  • Restart the Spotweb Docker container

Use SQLite instead of MySQL

SQLite is a light-weight serverless database engine and stores all content in a single file. Note that SQLite support in Spotweb is the least-tested database mode. Please report any issues to the Spotweb project.

  • Change the DB_ENGINE variable to pdo_sqlite
  • Set the path to the database file in DB_NAME
  • Make sure, your database directory (or file) is mounted as a volume to not lose all data when the container is rebuilt
docker run -p 8085:80 \
  --name spotweb -d \
  -e DB_ENGINE=pdo_sqlite \
  -e DB_NAME=/data/spotweb.db3 \
  -v /local/path/to/spotweb-data:/data:rw \
  erikdevries/spotweb

See docker-compose-sqlite.yml for an example Docker Compose setup.

Tip: Using ownsettings.php

You can override Spotweb settings by using a custom ownsettings.php file. In most cases there is no need to use this feature, so only use this when you know what you are doing!

The example below will mount /external/ownsettings.php to /app/ownsettings.php inside the container. Spotweb will see the ownsettings file and load it automatically.

volumes:
- /external/ownsettings.php:/app/ownsettings.php

Information

  • In the past separate images were created for x86 and arm in separate Docker Hub repositories, for the most up to date image please visit Docker Hub
  • Spotweb is configured as an open system after running docker compose up, so everyone who can access the site can register an account (keep this in mind, and also make sure to change the admin password if you plan to expose Spotweb to the outside world!)
  • If you want to use the Spotweb API, create a new user and use the API key associated with that user
  • See the official Spotweb Wiki for any questions regarding Spotweb

docker-spotweb's People

Contributors

edv avatar mlangenberg avatar mbirth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.