-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (53 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
69 lines (53 loc) · 1.55 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Build stage for React frontend
FROM node:18-alpine AS frontend-builder
WORKDIR /app/web
COPY web/package*.json ./
RUN npm install
COPY web/ ./
RUN npm run build
# Build stage for Go backend
FROM golang:1.21 AS backend-builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
# Build with CGO enabled for SQLite support
ENV CGO_ENABLED=1
RUN go build -o drummer
# Final stage
FROM python:3.8-slim
# Install system dependencies for Spleeter and FFmpeg
RUN apt-get update && apt-get install -y \
ffmpeg \
libsndfile1 \
libsndfile1-dev \
build-essential \
pkg-config \
libasound2-dev \
portaudio19-dev \
libportaudio2 \
libportaudiocpp0 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip and install Python dependencies with compatible versions
RUN pip install --upgrade pip==20.3.4 setuptools==57.5.0 wheel==0.37.1
# Install compatible versions step by step - use older numpy for TF 2.5
RUN pip install numpy==1.18.5
RUN pip install tensorflow==2.5.0
RUN pip install librosa==0.8.1
# Install Spleeter and yt-dlp - models will be downloaded at runtime
RUN pip install spleeter==2.3.2
RUN pip install --upgrade yt-dlp
# Update yt-dlp to the absolute latest version
RUN yt-dlp --update-to stable
WORKDIR /app
# Copy the Go binary
COPY --from=backend-builder /app/drummer .
# Copy the React build
COPY --from=frontend-builder /app/web/build ./web/build
# Create directories for uploads and database
RUN mkdir -p uploads processed temp data
# Expose port
EXPOSE 8080
# Run the application
CMD ["./drummer"]