From f217f3a3d661b60e1d579b01714e24436e7740bf Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Tue, 26 Nov 2024 13:43:10 +0530 Subject: [PATCH] Fix prod docker image (#2618) --- docker/prod.Dockerfile | 11 +++++++---- scripts/celery_beat.sh | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/prod.Dockerfile b/docker/prod.Dockerfile index b2fe64f7fe..ca99cf3767 100644 --- a/docker/prod.Dockerfile +++ b/docker/prod.Dockerfile @@ -22,9 +22,6 @@ ENV PATH=$APP_HOME/.venv/bin:$PATH # --- FROM base AS builder -RUN addgroup --system django \ - && adduser --system --ingroup django django - RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential libjpeg-dev zlib1g-dev libgmp-dev libpq-dev git wget \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ @@ -59,11 +56,16 @@ RUN python3 $APP_HOME/install_plugins.py # --- FROM base AS runtime +RUN addgroup --system django \ + && adduser --system --ingroup django django + RUN apt-get update && apt-get install --no-install-recommends -y \ libpq-dev libgmp-dev gettext wget curl gnupg \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* +RUN chown django:django $APP_HOME + COPY --from=builder --chmod=0755 /usr/local/bin/typst /usr/local/bin/typst COPY --from=builder --chown=django:django $APP_HOME/.venv $APP_HOME/.venv @@ -75,9 +77,10 @@ COPY --chown=django:django . $APP_HOME USER django HEALTHCHECK \ + --start-period=20s \ + --start-interval=1s \ --interval=30s \ --timeout=5s \ - --start-period=10s \ --retries=12 \ CMD ["./healthcheck.sh"] diff --git a/scripts/celery_beat.sh b/scripts/celery_beat.sh index dd1a5f36e5..96f552b9ea 100755 --- a/scripts/celery_beat.sh +++ b/scripts/celery_beat.sh @@ -9,7 +9,6 @@ set -euo pipefail python manage.py migrate --noinput python manage.py compilemessages -v 0 python manage.py load_redis_index -python manage.py load_event_types touch /tmp/healthy