WIP. A little custom music server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: mount volumes in dockerfile

+68 -2
+13 -1
backend/Dockerfile
··· 29 29 COPY --from=install /temp/prod/node_modules node_modules 30 30 COPY --from=prerelease /app/backend/dist . 31 31 32 + # Create directories for volumes with proper ownership 33 + RUN mkdir -p /app/data /app/music && \ 34 + chown -R bun:bun /app/data /app/music 35 + 36 + # Declare volumes 37 + VOLUME ["/app/data", "/app/music"] 38 + 32 39 USER bun 33 - EXPOSE 3000/tcp 40 + EXPOSE 3003/tcp 41 + 42 + # Set default environment variables 43 + ENV DB_URL=/app/data/boombox.db 44 + ENV FOLDER_PATH=/app/music 45 + 34 46 ENTRYPOINT [ "bun", "index.js" ]
+55 -1
backend/README.md
··· 1 1 # boombox 2 2 3 + Music streaming server built with Bun, Elysia, and Effect. 4 + 5 + ## Development 6 + 3 7 To install dependencies: 4 8 5 9 ```bash 6 10 bun install 7 11 ``` 8 12 9 - To run: 13 + To run locally: 10 14 11 15 ```bash 16 + # Set required environment variables 17 + export DB_URL=./data/boombox.db 18 + export FOLDER_PATH=/path/to/your/music 19 + 12 20 bun run src/index.ts 13 21 ``` 22 + 23 + ## Docker Deployment 24 + 25 + ### Using Docker Run 26 + 27 + Build the image: 28 + 29 + ```bash 30 + docker build -t boombox-backend . 31 + ``` 32 + 33 + Run the container: 34 + 35 + ```bash 36 + docker run -d \ 37 + --name boombox \ 38 + -p 3000:3000 \ 39 + -v /path/to/your/music:/app/music:ro \ 40 + -v boombox-data:/app/data \ 41 + boombox-backend 42 + ``` 43 + 44 + ### Using Docker Compose 45 + 46 + 1. Edit `docker-compose.yml` and update the music library path: 47 + 48 + ```yaml 49 + volumes: 50 + - /path/to/your/music:/app/music:ro # Update this path 51 + ``` 52 + 53 + 2. Start the service: 54 + 55 + ```bash 56 + docker compose up -d 57 + ``` 58 + 59 + ### Required Volumes 60 + 61 + - **Music Library** (`/app/music`): Mount your music folder here (read-only recommended) 62 + - **Database** (`/app/data`): Persistent storage for the SQLite database 63 + 64 + ### Environment Variables 65 + 66 + - `DB_URL`: Path to SQLite database file (default: `/app/data/boombox.db`) 67 + - `FOLDER_PATH`: Path to music library folder (default: `/app/music`) 14 68 15 69 This project was created using `bun init` in bun v1.2.2. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.