e79dae5d5c
- Dockerfile: build sfizz tu native_bridge/sfizz-src (hoac git clone v1.2.3), sed fix sfizz.pc (-llibsfizz -> -lsfizz), cmake bridge voi 3 flag SMTG OFF (VSTGUI/plugin/hosting examples) — bridge headless chi can --render. - CMakeLists: nhanh non-WIN32 build daw_vst_bridge tu main_linux.cpp + RenderJob.cpp + NativeInstrumentEngine.cpp (SF2/SF3 + SFZ; VST3/VST2 hosting Windows-only, guard #ifdef _WIN32). gui_probe/plugin_host/ seh_channel_test chi build tren Windows. - RenderJob.cpp: JSON parser (sheredom json.h) khong con phu thuoc HAVE_VST3SDK — render SF2/SFZ chay duoc khong can VST3 SDK. - NativeInstrumentEngine.cpp: guard windows.h/VST3/VST2/Sandbox/SEH. - main.cpp: g_engine unconditional + guard disable_ime_contexts (_WIN32). - engine.spec: bo pedalboard collect_dynamic_libs + hidden imports. - vst_engine/render_engine: DecentSampler -> NotImplementedError + huong dan convert .dspreset -> .vstpreset; pianobook fallback synth. - Verified: WSL Ubuntu 24.04 build OK, bridge Linux --render SF2 ra WAV 44100 stereo peak 1575; Python tests 115 passed 1 skipped. - Dockerfile build chua test duoc (may khong co Docker).
78 lines
3.1 KiB
Docker
78 lines
3.1 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 . .
|
|
|
|
# ── Build native_bridge (Linux) — thay pedalboard GPL-3.0 ──────────────────
|
|
# Xem PLAN_REPLACE_PEDALBOARD_NATIVE_BRIDGE.md §4. sfizz khong co trong apt
|
|
# Debian → build tu nguon vendored (native_bridge/sfizz-src, co trong build
|
|
# context) hoac git clone fallback khi thieu. Bridge chay --render duoi
|
|
# Xvfb :99 (DISPLAY da set o tren) — khong can GUI plugin editor.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
cmake pkg-config libfluidsynth-dev libfreetype-dev git \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& if [ -d native_bridge/sfizz-src ]; then cp -r native_bridge/sfizz-src /tmp/sfizz; \
|
|
else git clone --recursive --depth 1 --branch v1.2.3 https://github.com/sfztools/sfizz.git /tmp/sfizz; fi \
|
|
&& cmake -S /tmp/sfizz -B /tmp/sfizz/build -DCMAKE_BUILD_TYPE=Release \
|
|
-DSFIZZ_SHARED=ON -DSFIZZ_JACK=OFF -DSFIZZ_RENDER=OFF -DSFIZZ_TESTS=OFF \
|
|
-DSFIZZ_BENCHMARKS=OFF -DSFIZZ_DEMOS=OFF -DSFIZZ_DEVTOOLS=OFF \
|
|
-DSFIZZ_GIT_SUBMODULE_CHECK=OFF -DBUILD_TESTING=OFF \
|
|
&& cmake --build /tmp/sfizz/build --target sfizz_shared -j"$(nproc)" \
|
|
&& cmake --install /tmp/sfizz/build \
|
|
&& sed -i 's/-llibsfizz/-lsfizz/' /usr/local/lib/pkgconfig/sfizz.pc \
|
|
&& cmake -S native_bridge -B /tmp/bridge-build -DCMAKE_BUILD_TYPE=Release \
|
|
-DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF \
|
|
-DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF \
|
|
-DSMTG_ENABLE_VSTGUI_SUPPORT=OFF \
|
|
&& cmake --build /tmp/bridge-build --target daw_vst_bridge -j"$(nproc)" \
|
|
&& mkdir -p /app/install \
|
|
&& cp /tmp/bridge-build/daw_vst_bridge /app/install/ \
|
|
&& rm -rf /tmp/sfizz /tmp/sfizz/build /tmp/bridge-build
|
|
|
|
|
|
# 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"]
|