From e8c776ac66b96676a143818923e9cae0335acbf6 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 2 Sep 2025 04:58:50 +0300 Subject: [PATCH] feat: add WeasyPrint installation to Dockerfile and create startup scripts for Celery and FastAPI --- Dockerfile | 9 ++++++--- start_celery.sh | 1 + start_fastapi.sh | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 start_celery.sh create mode 100644 start_fastapi.sh diff --git a/Dockerfile b/Dockerfile index 2ea051f..e43de7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,9 +20,12 @@ RUN --mount=type=cache,target=/root/.cache/uv \ # Then, use a final image without uv FROM python:3.11-slim-bookworm -# It is important to use the image that matches the builder, as the path to the -# Python executable must be the same, e.g., using `python:3.11-slim-bookworm` -# will fail. + +RUN apt-get update && \ + apt-get install -y weasyprint && \ + apt clean && \ + rm -rf /var/cache/apt/* + # Copy the application from the builder COPY --from=builder --chown=app:app /app /app diff --git a/start_celery.sh b/start_celery.sh new file mode 100644 index 0000000..d78f21a --- /dev/null +++ b/start_celery.sh @@ -0,0 +1 @@ +celery -A background.celery_app worker --loglevel=info \ No newline at end of file diff --git a/start_fastapi.sh b/start_fastapi.sh new file mode 100644 index 0000000..5deb21b --- /dev/null +++ b/start_fastapi.sh @@ -0,0 +1 @@ +gunicorn main:app -w 4 \ No newline at end of file