dev #37
@@ -33,7 +33,7 @@ Configura il percorso di OrcaSlicer in `backend/src/main/resources/application.p
|
|||||||
|
|
||||||
- `MEDIA_STORAGE_ROOT` per la root `storage_media` usata dal backend (`original/`, `public/`, `private/`)
|
- `MEDIA_STORAGE_ROOT` per la root `storage_media` usata dal backend (`original/`, `public/`, `private/`)
|
||||||
- `SHOP_STORAGE_ROOT` per la root `storage_shop` usata dal backend per i modelli dei prodotti shop
|
- `SHOP_STORAGE_ROOT` per la root `storage_shop` usata dal backend per i modelli dei prodotti shop
|
||||||
- `MEDIA_FFMPEG_PATH` per il binario `ffmpeg` (nel deploy Docker default: `/usr/bin/ffmpeg`)
|
- `MEDIA_FFMPEG_PATH` per il binario `ffmpeg` (nel deploy Docker default: `/usr/local/bin/ffmpeg-media`)
|
||||||
- `MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES` per il limite per asset immagine
|
- `MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES` per il limite per asset immagine
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -107,7 +107,7 @@ Operativamente:
|
|||||||
Assicurati che `slicer.path` punti al binario corretto. Su macOS è solitamente `/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer`. Su Linux è il percorso all'AppImage (estratta o meno).
|
Assicurati che `slicer.path` punti al binario corretto. Su macOS è solitamente `/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer`. Su Linux è il percorso all'AppImage (estratta o meno).
|
||||||
|
|
||||||
### FFmpeg e media pubblici
|
### FFmpeg e media pubblici
|
||||||
Verifica che `MEDIA_FFMPEG_PATH` punti a un `ffmpeg` con supporto JPEG, WebP e AVIF (encoder + muxer AVIF). Nel container backend usa `/usr/bin/ffmpeg` per evitare binari bundled da OrcaSlicer con supporto incompleto. Se gli URL media restituiti dalle API admin non sono raggiungibili, controlla che `APP_FRONTEND_BASE_URL` punti al dominio corretto, che `location /media/` sia esposto da Nginx e che il volume `storage_media` sia montato correttamente.
|
Verifica che `MEDIA_FFMPEG_PATH` punti a un `ffmpeg` con supporto JPEG, WebP e AVIF (encoder + muxer AVIF). Nel container backend il default è `/usr/local/bin/ffmpeg-media`: usa `/usr/bin/ffmpeg` se già compatibile, altrimenti installa un fallback statico con supporto AVIF. Se gli URL media restituiti dalle API admin non sono raggiungibili, controlla che `APP_FRONTEND_BASE_URL` punti al dominio corretto, che `location /media/` sia esposto da Nginx e che il volume `storage_media` sia montato correttamente.
|
||||||
|
|
||||||
### Database connection
|
### Database connection
|
||||||
Verifica le credenziali in `application.properties`. Se usi Docker, puoi passare `DB_URL`, `DB_USERNAME` e `DB_PASSWORD` come variabili d'ambiente.
|
Verifica le credenziali in `application.properties`. Se usi Docker, puoi passare `DB_URL`, `DB_USERNAME` e `DB_PASSWORD` come variabili d'ambiente.
|
||||||
|
|||||||
@@ -12,28 +12,48 @@ RUN ./gradlew bootJar -x test --no-daemon
|
|||||||
FROM eclipse-temurin:21-jre-jammy
|
FROM eclipse-temurin:21-jre-jammy
|
||||||
ARG ORCA_VERSION=2.3.1
|
ARG ORCA_VERSION=2.3.1
|
||||||
ARG ORCA_DOWNLOAD_URL
|
ARG ORCA_DOWNLOAD_URL
|
||||||
|
ARG FFMPEG_STATIC_URL=https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
|
||||||
|
|
||||||
# Install system dependencies for OrcaSlicer and media processing.
|
# Install system dependencies for OrcaSlicer and media processing.
|
||||||
# The build fails fast if the packaged ffmpeg lacks JPEG/WebP/AVIF support.
|
# Prefer system ffmpeg; if AVIF support is incomplete, install a static ffmpeg fallback.
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
wget \
|
wget \
|
||||||
|
xz-utils \
|
||||||
|
ca-certificates \
|
||||||
assimp-utils \
|
assimp-utils \
|
||||||
libgl1 \
|
libgl1 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
libgtk-3-0 \
|
libgtk-3-0 \
|
||||||
libdbus-1-3 \
|
libdbus-1-3 \
|
||||||
libwebkit2gtk-4.0-37; \
|
libwebkit2gtk-4.0-37; \
|
||||||
ffmpeg -hide_banner -encoders > /tmp/ffmpeg-encoders.txt; \
|
check_ffmpeg_support() { \
|
||||||
grep -Eq '[[:space:]]mjpeg[[:space:]]' /tmp/ffmpeg-encoders.txt; \
|
ffmpeg_bin="$1"; \
|
||||||
grep -Eq '[[:space:]](libwebp|webp)[[:space:]]' /tmp/ffmpeg-encoders.txt; \
|
"$ffmpeg_bin" -hide_banner -encoders > /tmp/ffmpeg-encoders.txt 2>&1 || return 1; \
|
||||||
grep -Eq '[[:space:]](libaom-av1|librav1e|libsvtav1)[[:space:]]' /tmp/ffmpeg-encoders.txt; \
|
"$ffmpeg_bin" -hide_banner -muxers > /tmp/ffmpeg-muxers.txt 2>&1 || return 1; \
|
||||||
ffmpeg -hide_banner -muxers > /tmp/ffmpeg-muxers.txt; \
|
grep -Eq '[[:space:]]mjpeg[[:space:]]' /tmp/ffmpeg-encoders.txt || return 1; \
|
||||||
grep -Eq '[[:space:]]avif([[:space:]]|,|$)' /tmp/ffmpeg-muxers.txt; \
|
grep -Eq '[[:space:]](libwebp|webp)[[:space:]]' /tmp/ffmpeg-encoders.txt || return 1; \
|
||||||
|
grep -Eq '[[:space:]](libaom-av1|librav1e|libsvtav1)[[:space:]]' /tmp/ffmpeg-encoders.txt || return 1; \
|
||||||
|
grep -Eq '[[:space:]]avif([[:space:]]|,|$)' /tmp/ffmpeg-muxers.txt || return 1; \
|
||||||
|
return 0; \
|
||||||
|
}; \
|
||||||
|
if check_ffmpeg_support /usr/bin/ffmpeg; then \
|
||||||
|
ln -sf /usr/bin/ffmpeg /usr/local/bin/ffmpeg-media; \
|
||||||
|
else \
|
||||||
|
echo "System ffmpeg lacks AVIF support, installing static fallback from ${FFMPEG_STATIC_URL}"; \
|
||||||
|
wget -q "${FFMPEG_STATIC_URL}" -O /tmp/ffmpeg-static.tar.xz; \
|
||||||
|
tar -xJf /tmp/ffmpeg-static.tar.xz -C /tmp; \
|
||||||
|
FFMPEG_STATIC_BIN="$(find /tmp -maxdepth 2 -type f -name ffmpeg | head -n 1)"; \
|
||||||
|
test -n "${FFMPEG_STATIC_BIN}"; \
|
||||||
|
install -m 0755 "${FFMPEG_STATIC_BIN}" /usr/local/bin/ffmpeg-media; \
|
||||||
|
check_ffmpeg_support /usr/local/bin/ffmpeg-media; \
|
||||||
|
fi; \
|
||||||
rm -f /tmp/ffmpeg-muxers.txt; \
|
rm -f /tmp/ffmpeg-muxers.txt; \
|
||||||
rm -f /tmp/ffmpeg-encoders.txt; \
|
rm -f /tmp/ffmpeg-encoders.txt; \
|
||||||
|
rm -f /tmp/ffmpeg-static.tar.xz; \
|
||||||
|
rm -rf /tmp/ffmpeg-*-amd64-static; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install OrcaSlicer
|
# Install OrcaSlicer
|
||||||
@@ -74,8 +94,8 @@ ENV PATH="/opt/orcaslicer/usr/bin:${PATH}"
|
|||||||
# Set Slicer Path env variable for Java app
|
# Set Slicer Path env variable for Java app
|
||||||
ENV SLICER_PATH="/opt/orcaslicer/AppRun"
|
ENV SLICER_PATH="/opt/orcaslicer/AppRun"
|
||||||
ENV ASSIMP_PATH="assimp"
|
ENV ASSIMP_PATH="assimp"
|
||||||
# Keep media generation on the system ffmpeg (Orca bundles can miss AVIF muxer support).
|
# Use ffmpeg selected at image build time (system or static fallback) for media generation.
|
||||||
ENV MEDIA_FFMPEG_PATH="/usr/bin/ffmpeg"
|
ENV MEDIA_FFMPEG_PATH="/usr/local/bin/ffmpeg-media"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Copy JAR from build stage
|
# Copy JAR from build stage
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# In container default to system ffmpeg to avoid Orca-bundled binaries with partial codec support.
|
# In container default to the ffmpeg selected during image build.
|
||||||
if [ -z "${MEDIA_FFMPEG_PATH:-}" ]; then
|
if [ -z "${MEDIA_FFMPEG_PATH:-}" ]; then
|
||||||
MEDIA_FFMPEG_PATH="/usr/bin/ffmpeg"
|
MEDIA_FFMPEG_PATH="/usr/local/bin/ffmpeg-media"
|
||||||
fi
|
fi
|
||||||
export MEDIA_FFMPEG_PATH
|
export MEDIA_FFMPEG_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ services:
|
|||||||
- PROFILES_DIR=/app/profiles
|
- PROFILES_DIR=/app/profiles
|
||||||
- MEDIA_STORAGE_ROOT=${MEDIA_STORAGE_ROOT:-/app/storage_media}
|
- MEDIA_STORAGE_ROOT=${MEDIA_STORAGE_ROOT:-/app/storage_media}
|
||||||
- SHOP_STORAGE_ROOT=${SHOP_STORAGE_ROOT:-/app/storage_shop}
|
- SHOP_STORAGE_ROOT=${SHOP_STORAGE_ROOT:-/app/storage_shop}
|
||||||
- MEDIA_FFMPEG_PATH=${MEDIA_FFMPEG_PATH:-/usr/bin/ffmpeg}
|
- MEDIA_FFMPEG_PATH=${MEDIA_FFMPEG_PATH:-/usr/local/bin/ffmpeg-media}
|
||||||
- MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES=${MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES:-26214400}
|
- MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES=${MEDIA_UPLOAD_MAX_FILE_SIZE_BYTES:-26214400}
|
||||||
restart: always
|
restart: always
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
Reference in New Issue
Block a user