Files
SonicForgeStudio/Dockerfile
T
3dtours e51b7fd355 feat: SF3 conversion + SpessaSynth client player
Server:
- soundfont_converter.py: Python SF2->SF3 via ffmpeg Ogg compression
- batch_convert_all runs on startup (daemon thread)
- GET /soundfonts/download/{sf_id} serves SF3 with SF2 fallback
- Dockerfile: add fluidsynth, vorbis-tools

Client:
- soundfontStorage.js: IndexedDB cache for SF3 buffers
- soundfontPlayer.js: dual-mode (SpessaSynth + oscillator fallback)
- app.jsx: init SpessaSynth, loadSF on instrument select
- index.html: SpessaSynth CDN import + storage script tag

Compression: DSK 11M->1.1M (90%), SGM 529M->18M (97%)
2026-07-26 17:51:37 +07:00

51 lines
1.4 KiB
Docker

# Sử dụng Python 3.11 làm nền tảng
FROM python:3.11-slim
# Cài đặt các gói thư viện đồ hoạ và asound bắt buộc đối với JUCE / VST3 Linux (22_CLIENT_DESK.md)
RUN apt-get update && apt-get install -y \
libgl1 \
libglx-mesa0 \
libglu1-mesa \
libasound2 \
libjack-jackd2-0 \
libfreetype6 \
libfontconfig1 \
libx11-6 \
libxext6 \
libxinerama1 \
libxrandr2 \
libxcursor1 \
xvfb \
ffmpeg \
libsndfile1 \
libfluidsynth3 \
libcurl4 \
build-essential \
fluidsynth \
vorbis-tools \
&& rm -rf /var/lib/apt/lists/*
# Thiết lập biến môi trường hiển thị cho X11 ảo
ENV DISPLAY=:99
# Create VST3 and sample directories
RUN mkdir -p /opt/daw_engine/vst3 /opt/daw_engine/soundfonts /opt/daw_engine/samples/pianobook
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Copy VST3 plugins if present
COPY ./vst_plugins/ /opt/daw_engine/vst3/
# Tạo thư mục chứa file nhạc và cấp quyền ghi
RUN mkdir -p /app/app/storage/uploads /app/app/storage/processed && chmod -R 777 /app/app/storage
# Mặc định mở port 8000 cho FastAPI
EXPOSE 8000
# Khởi chạy Xvfb ảo ở cổng :99 trước khi kích hoạt FastAPI / Celery
CMD ["sh", "-c", "Xvfb :99 -screen 0 1024x768x16 & uvicorn app.main:app --host 0.0.0.0 --port 8000"]