Skip to content

Commit 5413112

Browse files
committed
chore: update docker-compose for multiarch
1 parent 0a25c7d commit 5413112

File tree

3 files changed

+80
-17
lines changed

3 files changed

+80
-17
lines changed

.github/workflows/docker-publish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Publish Docker Image
1+
name: Build and Publish Multi-Architecture Docker Image
22

33
on:
44
push:
@@ -19,14 +19,16 @@ jobs:
1919
permissions:
2020
contents: read
2121
packages: write
22-
# This is used to complete the identity challenge
23-
# with sigstore/fulcio when running outside of PRs.
2422
id-token: write
2523

2624
steps:
2725
- name: Checkout repository
2826
uses: actions/checkout@v3
2927

28+
# Set up QEMU for multi-architecture builds
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v2
31+
3032
# Set up Docker Buildx
3133
- name: Set up Docker Buildx
3234
uses: docker/setup-buildx-action@v2
@@ -52,12 +54,13 @@ jobs:
5254
type=sha,format=long
5355
type=raw,value=latest,enable={{is_default_branch}}
5456
55-
# Build and push Docker image
57+
# Build and push Docker image for multiple architectures
5658
- name: Build and push Docker image
5759
id: build-and-push
5860
uses: docker/build-push-action@v4
5961
with:
6062
context: .
63+
platforms: linux/amd64,linux/arm64
6164
push: ${{ github.event_name != 'pull_request' }}
6265
tags: ${{ steps.meta.outputs.tags }}
6366
labels: ${{ steps.meta.outputs.labels }}

README.md

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,88 @@ BookGrab focuses on doing one thing well: making it easy to search MAM and downl
2727

2828
### Prerequisites
2929

30-
- Node.js 18+ and npm
3130
- A MyAnonyMouse account and session token
3231
- A running Transmission client
3332

34-
### Environment Variables
33+
### Installation Options
3534

36-
Create a `.env.local` file in the root directory with the following variables:
35+
#### Option 1: Docker Compose (Recommended)
3736

37+
1. Create a `docker-compose.yml` file:
38+
39+
```yaml
40+
version: '3'
41+
42+
services:
43+
bookgrab:
44+
image: mrorbitman/bookgrab:latest
45+
container_name: bookgrab
46+
ports:
47+
- "3000:3000"
48+
environment:
49+
- MAM_TOKEN=your_mam_token_here
50+
- TRANSMISSION_URL=http://your-transmission-server:9091/transmission/rpc
51+
- AUDIOBOOK_DESTINATION_PATH=/path/to/audiobooks
52+
- EBOOK_DESTINATION_PATH=/path/to/ebooks
53+
restart: unless-stopped
3854
```
39-
MAM_TOKEN=your_mam_token_here
40-
TRANSMISSION_URL=http://your-transmission-server:9091/transmission/rpc
41-
AUDIOBOOK_DESTINATION_PATH=/path/to/audiobooks
42-
EBOOK_DESTINATION_PATH=/path/to/ebooks
55+
56+
2. Update the environment variables with your own values
57+
3. Run the container:
58+
59+
```bash
60+
docker-compose up -d
4361
```
4462

45-
### Installation
63+
4. Access BookGrab at http://localhost:3000
64+
65+
#### Option 2: Docker
4666

47-
1. Clone the repository
48-
2. Install dependencies:
67+
Run the container directly:
68+
69+
```bash
70+
docker run -d \
71+
--name bookgrab \
72+
-p 3000:3000 \
73+
-e MAM_TOKEN=your_mam_token_here \
74+
-e TRANSMISSION_URL=http://your-transmission-server:9091/transmission/rpc \
75+
-e AUDIOBOOK_DESTINATION_PATH=/path/to/audiobooks \
76+
-e EBOOK_DESTINATION_PATH=/path/to/ebooks \
77+
mrorbitman/bookgrab:latest
78+
```
79+
80+
#### Option 3: Manual Installation
81+
82+
1. Prerequisites:
83+
- Node.js 18+ and npm
84+
85+
2. Clone the repository
86+
3. Install dependencies:
4987

5088
```bash
5189
npm install
5290
```
5391

54-
3. Run the development server:
92+
4. Create a `.env.local` file in the root directory with the following variables:
93+
94+
```
95+
MAM_TOKEN=your_mam_token_here
96+
TRANSMISSION_URL=http://your-transmission-server:9091/transmission/rpc
97+
AUDIOBOOK_DESTINATION_PATH=/path/to/audiobooks
98+
EBOOK_DESTINATION_PATH=/path/to/ebooks
99+
```
100+
101+
5. Run the development server:
55102

56103
```bash
57104
npm run dev
58105
```
59106

60-
4. Open [http://localhost:3000](http://localhost:3000) with your browser to see the application.
107+
6. Open [http://localhost:3000](http://localhost:3000) with your browser to see the application.
108+
109+
### Building for Production
61110

62-
## Building for Production
111+
If you're installing manually, you can build for production:
63112

64113
```bash
65114
npm run build

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
3+
services:
4+
bookgrab:
5+
image: mrorbitman/bookgrab:latest
6+
container_name: bookgrab
7+
ports:
8+
- "3000:3000"
9+
env_file:
10+
- .env
11+
restart: unless-stopped

0 commit comments

Comments
 (0)