mirror of
https://github.com/casjaysdevdocker/ampache
synced 2026-07-31 14:11:37 -04:00
6fc0e54cc2675da4f7dc8fb54cd36de16c3511a5
The .local.sh block defined stub functions in memory but never wrote the file to disk, so __file_exists_with_content always failed and __create_service_env returned non-zero on every run. Fix: use a heredoc to write the stub functions into .local.sh. - rootfs/usr/local/etc/docker/init.d/99-ampache.sh: write .local.sh via heredoc in __create_service_env; bump version to 202606261600-git rootfs/usr/local/etc/docker/init.d/09-mariadb.sh rootfs/usr/local/etc/docker/init.d/99-ampache.sh
👋 Welcome to ampache 🚀
A self-contained Docker image for Ampache, the open-source web-based music streaming server. Bundles Apache 2, PHP 8.4 via PHP-FPM, MariaDB, and Ampache itself. First run opens the Ampache web installer at http://localhost:80/.
Install my system scripts
sudo bash -c "$(curl -q -LSsf "https://github.com/systemmgr/installer/raw/main/install.sh")"
sudo systemmgr --config && sudo systemmgr install scripts
Automatic install/update
dockermgr update ampache
Install and run container
dockerHome="/var/lib/srv/$USER/docker/casjaysdevdocker/ampache/ampache/latest/rootfs"
mkdir -p "/var/lib/srv/$USER/docker/ampache/rootfs"
git clone "https://github.com/dockermgr/ampache" "$HOME/.local/share/CasjaysDev/dockermgr/ampache"
cp -Rfva "$HOME/.local/share/CasjaysDev/dockermgr/ampache/rootfs/." "$dockerHome/"
docker run -d \
--restart always \
--privileged \
--name casjaysdevdocker-ampache-latest \
--hostname ampache \
-e TZ=${TIMEZONE:-America/New_York} \
-v "$dockerHome/data:/data:z" \
-v "$dockerHome/config:/config:z" \
-p 80:80 \
casjaysdevdocker/ampache:latest
via docker-compose
version: "2"
services:
ProjectName:
image: casjaysdevdocker/ampache
container_name: casjaysdevdocker-ampache
environment:
- TZ=America/New_York
- HOSTNAME=ampache
volumes:
- "/var/lib/srv/$USER/docker/casjaysdevdocker/ampache/ampache/latest/rootfs/data:/data:z"
- "/var/lib/srv/$USER/docker/casjaysdevdocker/ampache/ampache/latest/rootfs/config:/config:z"
ports:
- 80:80
restart: always
Environment variables
| Variable | Default | Description |
|---|---|---|
TZ |
America/New_York |
Container timezone (sets PHP date.timezone) |
MARIADB_ROOT_USER_NAME |
root |
MariaDB root username |
MARIADB_ROOT_PASS_WORD |
random |
MariaDB root password (auto-generated if random) |
MARIADB_USER_NAME |
ampache |
MariaDB application username |
MARIADB_USER_PASS_WORD |
random |
MariaDB application password (auto-generated if random) |
DATABASE_CREATE |
ampache |
MariaDB database name to create |
HOSTNAME |
ampache |
Container hostname used in Apache vhost |
DEBUGGER |
(unset) | Set to on to enable bash set -x debugging |
Passwords generated on first run are saved to /config/secure/auth/.
Volumes
| Path | Purpose |
|---|---|
/config |
All user-editable config files (Apache 2, PHP 8.4, MariaDB, Ampache) |
/data |
MariaDB data (/data/db/mariadb), logs (/data/logs/), and media library |
Ports
| Port | Protocol | Description |
|---|---|---|
80 |
HTTP | Ampache web UI and API |
443 |
HTTPS | Available when SSL is enabled via /config/enable/ssl |
Get source files
dockermgr download src casjaysdevdocker/ampache
OR
git clone "https://github.com/casjaysdevdocker/ampache" "$HOME/Projects/github/casjaysdevdocker/ampache"
Build container
cd "$HOME/Projects/github/casjaysdevdocker/ampache"
buildx
Authors
Description
Languages
Shell
94.3%
Dockerfile
5.7%