Castopod configuration

I just setup a castopod instance to self-host some audio files, and so far it seems to work. To get it to work, I used tweaked the default configuration a bit as follows.

On a server, make a new folder called castopod and added a new docker-compose.yml file:

services:
  castopod:
    image: 'castopod/castopod:1.14.0'
    container_name: 'castopod'
    volumes:
      - './media:/var/www/castopod/public/media'
    environment:
      MYSQL_DATABASE: 'castopod'
      MYSQL_USER: 'castopod'
      CP_BASEURL: 'https://<DOMAIN>'
      CP_ANALYTICS_SALT: '<PASSWORD 1>'
      CP_REDIS_HOST: 'redis'
      MYSQL_PASSWORD: '<PASSWORD 2>'
      CP_REDIS_PASSWORD: '<PASSWORD 3>'
    networks:
      - castopod
      - castopod-db
    ports:
      - '3005:8000'
    restart: unless-stopped

  mariadb:
    image: 'mariadb:11.2'
    container_name: 'castopod-mariadb'
    networks:
      - 'castopod-db'
    volumes:
      - './mariadb:/var/lib/mysql'
    environment:
      MYSQL_DATABASE: 'castopod'
      MYSQL_USER: 'castopod'
      MYSQL_PASSWORD: '<PASSWORD 2>'
      MYSQL_ROOT_PASSWORD: '<PASSWORD 2>'
    restart: 'unless-stopped'

  redis:
    image: 'redis:7.2-alpine'
    container_name: 'castopod-redis'
    command: --requirepass '<PASSWORD 3>'
    volumes:
      - './cache:/data'
    networks:
      - 'castopod'

networks:
  castopod:
  castopod-db:

Although Redis is only for caching, it is a must-have otherwise users can only jump through episodes a few minutes at the time. With Redis, users can just click any point in the episode to jump to it.

Next, make a setup.sh file with:

#!/usr/bin/env bash

set -euxo pipefail

mkdir -p mariadb
chmod -R 777 mariadb
mkdir -p media
chmod -R 777 media
mkdir -p cache
chmod -R 777 cache

And add

https://<DOMAIN> {
  reverse_proxy :3005
}

to your Caddyfile.

When you correctly forward the A record to your <DOMAIN> and run bash setup.sh and docker compose up, your Castopod instance should be available at <DOMAIN>, and you can configure it by going to <DOMAIN>/cp-install.