This commit is contained in:
Manuel
2025-09-17 23:29:48 +02:00
parent 2e863dc6a8
commit f156679578
3 changed files with 13 additions and 10 deletions

View File

@@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pngquant \ pngquant \
pandoc \ pandoc \
resvg \ resvg \
sox \
libvips-tools \ libvips-tools \
build-essential \ build-essential \
pkg-config \ pkg-config \
@@ -53,4 +54,4 @@ COPY . .
EXPOSE 8000 EXPOSE 8000
RUN chmod +x run.sh RUN chmod +x run.sh
# Command to run when container starts # Command to run when container starts
CMD ["./run.sh"] CMD ["./run.sh", "&"]

View File

@@ -5,13 +5,15 @@ services:
build: . build: .
env_file: env_file:
- .env - .env
#user: "1000:1000"
ports: ports:
- "8000:8000" - "6969:8000"
volumes: volumes:
# Mount local directories and files into the container for persistence # Mount local directories and files into the container for persistence
- ./uploads:/app/uploads - ./uploads_data:/app/uploads
- ./processed:/app/processed - ./processed_data:/app/processed
- ./settings.yml:/app/settings.yml
- ./jobs.db:/app/jobs.db
- ./huey.db:/app/huey.db
volumes:
uploads_data: {}
processed_data: {}

4
run.sh
View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# This script starts the FastAPI application using Gunicorn. # This script starts the FastAPI application using Gunicorn.
echo "Starting DocProcessor with Gunicorn..." echo "Starting DocProcessor with Gunicorn on port 0.0.0.0:8000..."
exec gunicorn -w 4 --threads 2 -k uvicorn.workers.UvicornWorker --forwarded-allow-ips='*' main:app -b 0.0.0.0:8000 & exec gunicorn -w 4 --threads 2 -k uvicorn.workers.UvicornWorker --forwarded-allow-ips='*' main:app -b 0.0.0.0:8000 &
echo "Done" echo "Done"
echo "Starting huey..." echo "Starting huey..."
exec huey_consumer.py main.huey -w 4 & exec huey_consumer.py main.huey -w 4
echo "Done" echo "Done"