-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-docker.sh
More file actions
38 lines (29 loc) · 1.05 KB
/
build-docker.sh
File metadata and controls
38 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Local Docker build script
# This script prepares the build context for Docker with the go-audible dependency
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="$(mktemp -d)"
echo "Preparing Docker build context in $BUILD_DIR..."
# Copy audplexus
echo "Copying audplexus..."
cp -r "$SCRIPT_DIR" "$BUILD_DIR/audplexus"
# Copy or clone go-audible
if [ -d "$SCRIPT_DIR/../go-audible" ]; then
echo "Copying local go-audible from ../go-audible..."
cp -r "$SCRIPT_DIR/../go-audible" "$BUILD_DIR/go-audible"
else
echo "Cloning go-audible from GitHub..."
git clone https://github.com/mstrhakr/go-audible.git "$BUILD_DIR/go-audible"
fi
# Build the Docker image
echo "Building Docker image..."
cd "$BUILD_DIR"
docker build -f audplexus/Dockerfile -t audplexus:local .
echo "Cleaning up build context..."
rm -rf "$BUILD_DIR"
echo ""
echo "✅ Docker image built successfully as 'audplexus:local'"
echo ""
echo "To run:"
echo " docker run -d -p 8080:8080 -v ./config:/config -v ./audiobooks:/audiobooks audplexus:local"