fix(dwg): correct ODA download URL + dynamic binary path lookup
- Use www.opendesign.com/guestfiles/get URL (no auth required) - Auto-find and symlink ODA binary after dpkg install - app.py searches multiple common install paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
# ODA File Converter needs Qt libs + virtual framebuffer for headless mode
|
# Qt libs + virtual framebuffer for headless ODA File Converter
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
python3 python3-pip wget ca-certificates \
|
python3 python3-pip wget ca-certificates \
|
||||||
@@ -10,14 +10,17 @@ RUN apt-get update && \
|
|||||||
libglib2.0-0 libgl1 libfontconfig1 libfreetype6 && \
|
libglib2.0-0 libgl1 libfontconfig1 libfreetype6 && \
|
||||||
pip3 install --no-cache-dir --break-system-packages flask && \
|
pip3 install --no-cache-dir --break-system-packages flask && \
|
||||||
apt-get purge -y python3-pip && \
|
apt-get purge -y python3-pip && \
|
||||||
apt-get autoremove -y && \
|
apt-get autoremove -y
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Download and install ODA File Converter
|
# Download and install ODA File Converter
|
||||||
RUN wget -q "https://download.opendesign.com/guestfiles/Demo/ODAFileConverter_QT6_lnxX64_8.3dll_25.12.deb" \
|
RUN wget -q "https://www.opendesign.com/guestfiles/get?filename=ODAFileConverter_QT6_lnxX64_8.3dll_27.1.deb" \
|
||||||
-O /tmp/oda.deb && \
|
-O /tmp/oda.deb && \
|
||||||
dpkg -i /tmp/oda.deb || apt-get install -f -y && \
|
dpkg -i /tmp/oda.deb || apt-get install -f -y && \
|
||||||
rm /tmp/oda.deb
|
rm /tmp/oda.deb && \
|
||||||
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
# Find the binary and symlink to /usr/local/bin for PATH access
|
||||||
|
find / -name "ODAFileConverter" -type f -executable 2>/dev/null | head -1 | \
|
||||||
|
xargs -I{} ln -sf {} /usr/local/bin/ODAFileConverter
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY app.py .
|
COPY app.py .
|
||||||
|
|||||||
+8
-2
@@ -13,8 +13,14 @@ app = Flask(__name__)
|
|||||||
|
|
||||||
MAX_FILE_SIZE = 100 * 1024 * 1024 # 100 MB
|
MAX_FILE_SIZE = 100 * 1024 * 1024 # 100 MB
|
||||||
|
|
||||||
# ODA File Converter installs here on Ubuntu
|
# ODA File Converter — try common install paths
|
||||||
ODA_BIN = "/usr/bin/ODAFileConverter"
|
ODA_BIN = "/usr/local/bin/ODAFileConverter"
|
||||||
|
for _p in ["/usr/local/bin/ODAFileConverter", "/usr/bin/ODAFileConverter",
|
||||||
|
"/opt/ODAFileConverter/ODAFileConverter",
|
||||||
|
"/opt/oda-file-converter/ODAFileConverter"]:
|
||||||
|
if os.path.isfile(_p):
|
||||||
|
ODA_BIN = _p
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
@app.route("/health", methods=["GET"])
|
@app.route("/health", methods=["GET"])
|
||||||
|
|||||||
Reference in New Issue
Block a user