prod deployment set up

This commit is contained in:
zipben 2025-06-04 15:50:32 -04:00
parent d4ab0358f6
commit ece1cd06a5
3 changed files with 151 additions and 0 deletions

114
DEPLOYMENT.md Normal file
View file

@ -0,0 +1,114 @@
# Audiobookshelf Deployment Guide
## Prerequisites
- Docker Desktop (for local deployment)
- Portainer (optional, for container management)
- At least 1GB of free RAM
- Sufficient disk space for your audiobooks and metadata
## Directory Structure
```
audiobookshelf/
├── audiobooks/ # Your audiobooks directory
├── podcasts/ # Your podcasts directory
├── metadata/ # Application metadata
├── config/ # Configuration files
├── client/ # Frontend source code
├── server/ # Backend source code
├── Dockerfile # Docker build instructions
└── docker-compose.prod.yml
External Directories:
/libraries/ # Additional media libraries directory (customizable path)
```
## Deployment Steps
### Using Docker Desktop
1. Create the required directories:
```bash
mkdir -p audiobooks podcasts metadata config
```
2. Configure your libraries path: Edit `docker-compose.prod.yml` and modify the libraries volume mount to point to your desired path:
```yaml
volumes:
- /path/to/your/libraries:/libraries
```
3. Build and start the application:
```bash
# Build the image
docker compose -f docker-compose.prod.yml build
# Start the containers
docker compose -f docker-compose.prod.yml up -d
```
4. Access the application at `http://localhost:13378`
### Using Portainer
1. In Portainer, go to "Stacks" and click "Add Stack"
2. Give your stack a name (e.g., "audiobookshelf")
3. Copy the contents of `docker-compose.prod.yml` into the web editor
4. Modify the libraries volume mount path to match your system
5. Enable "Build Image" option in Portainer
6. Click "Deploy the stack"
## Configuration
- The application runs on port 13378 by default
- Data is persisted in the mounted volumes:
- `./audiobooks`: Default audiobooks directory
- `./podcasts`: Default podcasts directory
- `./metadata`: Application metadata
- `./config`: Configuration files
- `/libraries`: Additional media libraries (customize path in docker-compose.prod.yml)
- Timezone can be configured in the docker-compose file
- User/Group IDs can be set via PUID/PGID environment variables
## Post-Installation
1. On first run, create an admin account
2. Configure your libraries in the web interface:
- Set up the default audiobooks and podcasts directories
- Add additional libraries from the `/libraries` mount point
3. Add your media files to the appropriate directories
## Updating
When you make changes to your code:
```bash
# Rebuild the image with your changes
docker compose -f docker-compose.prod.yml build
# Restart the containers with the new image
docker compose -f docker-compose.prod.yml up -d
```
## Backup
Important directories to backup:
- `config/` - Contains application settings and database
- `metadata/` - Contains metadata for your media
- `audiobooks/` and `podcasts/` - Your media files
- Any additional libraries you've configured
## Troubleshooting
- Check container logs: `docker logs audiobookshelf`
- Ensure proper file permissions on mounted volumes
- Verify port 13378 is not in use by another application
- Check resource usage in Docker Desktop dashboard
- Build logs: `docker compose -f docker-compose.prod.yml build --progress=plain`
- Check that all volume mount paths exist and are accessible
- Verify file permissions on the libraries directory

37
docker-compose.prod.yml Normal file
View file

@ -0,0 +1,37 @@
version: '3.8'
services:
audiobookshelf:
build:
context: .
dockerfile: Dockerfile
container_name: audiobookshelf
ports:
- "13378:80" # The app will be available on port 13378
volumes:
# Main storage volumes
- ./audiobooks:/audiobooks # Your audiobooks directory
- ./podcasts:/podcasts # Your podcasts directory
- ./metadata:/metadata # Metadata storage
- ./config:/config # Configuration files
- /Users/benjamindonaldson/Downloads:/libraries # Additional libraries directory (customize this path)
environment:
- TZ=America/New_York # Set your timezone
- PUID=1000 # Set to your user ID (optional)
- PGID=1000 # Set to your group ID (optional)
# Additional optional environment variables:
# - PORT=80 # Internal port (don't change unless necessary)
# - HOST=0.0.0.0 # Listen on all interfaces
restart: unless-stopped
networks:
- abs_network
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:80/ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
abs_network:
driver: bridge