Skip to content

Commit 56b5606

Browse files
fix(docker): corregge sintassi script pre-download Tika con heredoc
1 parent b1552d3 commit 56b5606

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Fixed
11+
- Dockerfile.tika Tika pre-download script now uses heredoc for proper Python syntax
12+
1013
## [1.1.3] - 2025-12-02
1114

1215
### Fixed

Dockerfile.tika

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,27 @@ RUN ollama serve & \
8383
pkill ollama || true
8484

8585
# Pre-download Tika JAR and ensure it's in the expected location
86-
RUN python3 -c "\
87-
import os, shutil; \
88-
from tika import parser, tika; \
89-
# Trigger download \
90-
parser.from_buffer(b'test', xmlContent=False); \
91-
# Get the actual JAR path \
92-
jar_path = getattr(tika, 'TikaJarPath', None); \
93-
print(f'Tika JAR downloaded to: {jar_path}'); \
94-
# Copy to expected location if different \
95-
if jar_path and os.path.exists(jar_path) and jar_path != '/tmp/tika-server.jar': \
96-
shutil.copy2(jar_path, '/tmp/tika-server.jar'); \
97-
print('Copied to /tmp/tika-server.jar'); \
98-
# Verify \
99-
assert os.path.exists('/tmp/tika-server.jar'), 'Tika JAR not found at /tmp/tika-server.jar'; \
100-
print('Tika JAR verified at /tmp/tika-server.jar'); \
101-
" || echo "WARNING: Tika JAR pre-download failed, will download at runtime"
86+
RUN python3 <<'PYEOF'
87+
import os
88+
import shutil
89+
from tika import parser, tika
90+
91+
# Trigger download
92+
parser.from_buffer(b'test', xmlContent=False)
93+
94+
# Get the actual JAR path
95+
jar_path = getattr(tika, 'TikaJarPath', None)
96+
print(f'Tika JAR downloaded to: {jar_path}')
97+
98+
# Copy to expected location if different
99+
if jar_path and os.path.exists(jar_path) and jar_path != '/tmp/tika-server.jar':
100+
shutil.copy2(jar_path, '/tmp/tika-server.jar')
101+
print('Copied to /tmp/tika-server.jar')
102+
103+
# Verify
104+
assert os.path.exists('/tmp/tika-server.jar'), 'Tika JAR not found at /tmp/tika-server.jar'
105+
print('Tika JAR verified at /tmp/tika-server.jar')
106+
PYEOF
102107

103108
# Create data directory for Qdrant
104109
RUN mkdir -p /data/qdrant

0 commit comments

Comments
 (0)