From 39c33273ef476e97c6f0d37a8265ce5a8a022a38 Mon Sep 17 00:00:00 2001 From: Nick Zeng Date: Mon, 18 May 2026 16:33:05 +0800 Subject: [PATCH] update backend build --- backend/Dockerfile | 8 +++++--- backend/entrypoint.sh | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 508c7b4..645f533 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -10,20 +10,22 @@ ENV TIMEZONE=${TIMEZONE} \ APP_ENV=prod \ SCAN_CACHEABLE=(true) +RUN apk add --no-cache php83-intl php83-pspell + RUN set -eux; \ php -v; php -m; php --ri swoole; \ cd /etc/php*; \ { \ echo "upload_max_filesize=128M"; \ echo "post_max_size=128M"; \ - echo "memory_limit=1G"; \ + echo "memory_limit=2G"; \ echo "date.timezone=${TIMEZONE}"; \ } | tee conf.d/99_overrides.ini; \ ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime; \ echo "${TIMEZONE}" > /etc/timezone; \ rm -rf /var/cache/apk/* /tmp/* /usr/share/man -WORKDIR /opt/www +WORKDIR /var/www COPY composer.json composer.lock ./ RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist --no-interaction @@ -40,4 +42,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \ CMD wget -qO- http://127.0.0.1:9501/health || exit 1 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -CMD ["php", "/opt/www/bin/hyperf.php", "start"] +CMD ["php", "/var/www/bin/hyperf.php", "start"] diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 320dc85..9e96d5f 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -32,10 +32,10 @@ wait_tcp "${DB_HOST}" "${DB_PORT}" "postgres" "${WAIT_TIMEOUT}" wait_tcp "${AMQP_HOST}" "${AMQP_PORT}" "rabbitmq" "${WAIT_TIMEOUT}" echo "[entrypoint] running migrate --force" -php /opt/www/bin/hyperf.php migrate --force +php /var/www/bin/hyperf.php migrate --force echo "[entrypoint] running app:install" -php /opt/www/bin/hyperf.php app:install +php /var/www/bin/hyperf.php app:install echo "[entrypoint] handing off to: $*" exec "$@"