Spaces:
Sleeping
Sleeping
ABDAN HAFIDZ commited on
Update Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768FROM php:8.4-cliARG VITE_APP_NAME=LaravelARG RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v1ARG VITE_RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v1ENV APP_NAME="${VITE_APP_NAME}" \APP_ENV=production \APP_DEBUG=false \APP_URL=http://localhost \LOG_CHANNEL=stderr \LOG_LEVEL=debug \SESSION_DRIVER=file \CACHE_STORE=file \QUEUE_CONNECTION=sync \DB_CONNECTION=sqlite \PORT=7860 \RAG_API_BASE_URL="${RAG_API_BASE_URL}" \VITE_RAG_API_BASE_URL="${VITE_RAG_API_BASE_URL}" \VITE_APP_NAME="${VITE_APP_NAME}"RUN apt-get update && apt-get install -y \git unzip curl zip ca-certificates gnupg \libzip-dev \libpng-dev \libjpeg-dev \libfreetype6-dev \libonig-dev \libxml2-dev \libsqlite3-dev \&& docker-php-ext-install \zip \pdo \pdo_mysql \pdo_sqlite \mbstring \exif \pcntl \bcmath \gd \&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \&& apt-get install -y nodejs \&& rm -rf /var/lib/apt/lists/*COPY --from=composer:2 /usr/bin/composer /usr/bin/composerRUN useradd -m -u 1000 userENV HOME=/home/userRUN mkdir -p /home/user/app && chown user:user /home/user/appWORKDIR /home/user/appCOPY --chown=user:user . .USER userRUN composer install --no-dev --optimize-autoloader --no-interaction --no-scripts \&& php artisan package:discover --ansi \&& php artisan config:clear \&& php artisan route:clear \&& npm ci \&& npm run build \&& rm -rf node_modules \&& php artisan view:clearEXPOSE 7860CMD ["sh", "-c", "if [ -n \"$SPACE_HOST\" ] && [ \"$APP_URL\" = \"http://localhost\" ]; then export APP_URL=\"https://$SPACE_HOST\"; fi; if [ -n \"$SPACE_HOST\" ] && [ -z \"$ASSET_URL\" ]; then export ASSET_URL=\"https://$SPACE_HOST\"; fi; if [ -z \"$APP_KEY\" ]; then export APP_KEY=$(php artisan key:generate --show --no-interaction); fi; php artisan serve --host=0.0.0.0 --port=${PORT:-7860}"]12345COPY docker/entrypoint.sh /entrypoint.shRUN chmod +x /entrypoint.shENTRYPOINT ["/entrypoint.sh"]
Dockerfile+3-66