Upload 38 files
Browse files- .dockerignore +46 -0
- Dockerfile +16 -13
- build_test.ps1 +13 -0
- build_test.sh +14 -0
- packages.txt +7 -1
.dockerignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# .dockerignore file for DOCX to PDF Converter
|
| 2 |
+
|
| 3 |
+
# Ignore Git directory
|
| 4 |
+
.git/
|
| 5 |
+
|
| 6 |
+
# Ignore Python cache
|
| 7 |
+
__pycache__/
|
| 8 |
+
*.pyc
|
| 9 |
+
*.pyo
|
| 10 |
+
*.pyd
|
| 11 |
+
.Python
|
| 12 |
+
|
| 13 |
+
# Ignore test files
|
| 14 |
+
test_*.py
|
| 15 |
+
*_test.py
|
| 16 |
+
test/
|
| 17 |
+
|
| 18 |
+
# Ignore logs
|
| 19 |
+
*.log
|
| 20 |
+
|
| 21 |
+
# Ignore virtual environments
|
| 22 |
+
venv/
|
| 23 |
+
env/
|
| 24 |
+
.venv/
|
| 25 |
+
.env/
|
| 26 |
+
|
| 27 |
+
# Ignore IDE files
|
| 28 |
+
.vscode/
|
| 29 |
+
.idea/
|
| 30 |
+
*.swp
|
| 31 |
+
*.swo
|
| 32 |
+
|
| 33 |
+
# Ignore OS files
|
| 34 |
+
.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
|
| 37 |
+
# Ignore temporary files
|
| 38 |
+
tmp/
|
| 39 |
+
temp/
|
| 40 |
+
*.tmp
|
| 41 |
+
|
| 42 |
+
# Ignore documentation files that aren't needed in the container
|
| 43 |
+
*.md
|
| 44 |
+
*.txt
|
| 45 |
+
*.pdf
|
| 46 |
+
*.docx
|
Dockerfile
CHANGED
|
@@ -41,6 +41,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 41 |
# Generate Arabic locale
|
| 42 |
RUN locale-gen ar_SA.UTF-8
|
| 43 |
|
|
|
|
|
|
|
|
|
|
| 44 |
# Set working directory
|
| 45 |
WORKDIR /app
|
| 46 |
|
|
@@ -48,29 +51,29 @@ WORKDIR /app
|
|
| 48 |
COPY requirements.txt .
|
| 49 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
# Copy application files
|
| 52 |
COPY app.py .
|
| 53 |
COPY main.py .
|
| 54 |
COPY arabic_fonts_setup.sh .
|
| 55 |
COPY libreoffice_arabic_config.xml .
|
| 56 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
# Setup additional Arabic fonts
|
| 59 |
RUN chmod +x arabic_fonts_setup.sh && \
|
| 60 |
-
./arabic_fonts_setup.sh
|
| 61 |
-
|
| 62 |
-
# Update font cache
|
| 63 |
-
RUN fc-cache -fv
|
| 64 |
-
|
| 65 |
-
# Create necessary directories
|
| 66 |
-
RUN mkdir -p /tmp/libreoffice_conversion
|
| 67 |
|
| 68 |
# Expose port
|
| 69 |
EXPOSE 8000
|
| 70 |
|
| 71 |
-
# Health check
|
| 72 |
-
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 73 |
-
CMD curl -f http://localhost:8000/ || exit 1
|
| 74 |
-
|
| 75 |
# Run the application
|
| 76 |
-
CMD ["python3", "main.py"]
|
|
|
|
| 41 |
# Generate Arabic locale
|
| 42 |
RUN locale-gen ar_SA.UTF-8
|
| 43 |
|
| 44 |
+
# Update font cache
|
| 45 |
+
RUN fc-cache -fv
|
| 46 |
+
|
| 47 |
# Set working directory
|
| 48 |
WORKDIR /app
|
| 49 |
|
|
|
|
| 51 |
COPY requirements.txt .
|
| 52 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 53 |
|
| 54 |
+
# Create necessary directories
|
| 55 |
+
RUN mkdir -p /tmp/libreoffice_conversion
|
| 56 |
+
|
| 57 |
+
# Create static directory
|
| 58 |
+
RUN mkdir -p static
|
| 59 |
+
|
| 60 |
# Copy application files
|
| 61 |
COPY app.py .
|
| 62 |
COPY main.py .
|
| 63 |
COPY arabic_fonts_setup.sh .
|
| 64 |
COPY libreoffice_arabic_config.xml .
|
| 65 |
+
COPY arial.ttf .
|
| 66 |
+
COPY packages.txt .
|
| 67 |
+
|
| 68 |
+
# Copy static files
|
| 69 |
+
COPY static/index.html ./static/
|
| 70 |
|
| 71 |
# Setup additional Arabic fonts
|
| 72 |
RUN chmod +x arabic_fonts_setup.sh && \
|
| 73 |
+
./arabic_fonts_setup.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
# Expose port
|
| 76 |
EXPOSE 8000
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
# Run the application
|
| 79 |
+
CMD ["python3", "main.py"]
|
build_test.ps1
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Simple build test script for Windows
|
| 2 |
+
|
| 3 |
+
Write-Host "Testing Docker build locally..."
|
| 4 |
+
|
| 5 |
+
# Build the Docker image
|
| 6 |
+
docker build -t docx-to-pdf-converter .
|
| 7 |
+
|
| 8 |
+
if ($LASTEXITCODE -eq 0) {
|
| 9 |
+
Write-Host "Build successful!"
|
| 10 |
+
} else {
|
| 11 |
+
Write-Host "Build failed!"
|
| 12 |
+
exit 1
|
| 13 |
+
}
|
build_test.sh
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Simple build test script
|
| 3 |
+
|
| 4 |
+
echo "Testing Docker build locally..."
|
| 5 |
+
|
| 6 |
+
# Build the Docker image
|
| 7 |
+
docker build -t docx-to-pdf-converter .
|
| 8 |
+
|
| 9 |
+
if [ $? -eq 0 ]; then
|
| 10 |
+
echo "Build successful!"
|
| 11 |
+
else
|
| 12 |
+
echo "Build failed!"
|
| 13 |
+
exit 1
|
| 14 |
+
fi
|
packages.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
libreoffice
|
| 2 |
libreoffice-writer
|
| 3 |
libreoffice-l10n-ar
|
|
|
|
| 4 |
fonts-liberation
|
| 5 |
fonts-liberation2
|
| 6 |
fonts-dejavu
|
|
@@ -11,9 +12,14 @@ fonts-noto-core
|
|
| 11 |
fonts-noto-ui-core
|
| 12 |
fonts-noto-mono
|
| 13 |
fonts-noto-color-emoji
|
| 14 |
-
fonts-noto
|
|
|
|
| 15 |
fonts-opensymbol
|
| 16 |
fonts-freefont-ttf
|
|
|
|
|
|
|
| 17 |
fontconfig
|
| 18 |
wget
|
| 19 |
curl
|
|
|
|
|
|
|
|
|
| 1 |
libreoffice
|
| 2 |
libreoffice-writer
|
| 3 |
libreoffice-l10n-ar
|
| 4 |
+
libreoffice-help-ar
|
| 5 |
fonts-liberation
|
| 6 |
fonts-liberation2
|
| 7 |
fonts-dejavu
|
|
|
|
| 12 |
fonts-noto-ui-core
|
| 13 |
fonts-noto-mono
|
| 14 |
fonts-noto-color-emoji
|
| 15 |
+
fonts-noto-naskh
|
| 16 |
+
fonts-noto-kufi-arabic
|
| 17 |
fonts-opensymbol
|
| 18 |
fonts-freefont-ttf
|
| 19 |
+
fonts-amiri
|
| 20 |
+
fonts-scheherazade-new
|
| 21 |
fontconfig
|
| 22 |
wget
|
| 23 |
curl
|
| 24 |
+
unzip
|
| 25 |
+
locales
|