Spaces:
Sleeping
Sleeping
Merge pull request #20 from capstone-if-26/dev
Browse filesFiles changed (9)
- .dockerignore+1-1
- .envAdded+66
- .env.example-1
- .gitignore-1
- Dockerfile+38-28
- entrypoint.sh+30-15
- resources/js/pages/mahasiswa-chat.tsx+1-1
- resources/js/pages/mahasiswa.tsx+1-1
- vite.config.ts+12-2
6 unmodified lines7891010111213146 unmodified linesvendorpublic/build
.env.env.*!.env!.env.example
database/*.sqlite123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566APP_NAME="RAG Hub"APP_ENV=localAPP_KEY=APP_DEBUG=trueAPP_URL=http://localhost:8000
APP_LOCALE=enAPP_FALLBACK_LOCALE=enAPP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file# APP_MAINTENANCE_STORE=database
# PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
LOG_CHANNEL=stackLOG_STACK=singleLOG_DEPRECATIONS_CHANNEL=nullLOG_LEVEL=debug
DB_CONNECTION=sqlite# DB_HOST=127.0.0.1# DB_PORT=3306# DB_DATABASE=laravel# DB_USERNAME=root# DB_PASSWORD=
SESSION_DRIVER=fileSESSION_LIFETIME=120SESSION_ENCRYPT=falseSESSION_PATH=/SESSION_DOMAIN=null
BROADCAST_CONNECTION=logFILESYSTEM_DISK=localQUEUE_CONNECTION=sync
CACHE_STORE=file# CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredisREDIS_HOST=127.0.0.1REDIS_PASSWORD=nullREDIS_PORT=6379
MAIL_MAILER=logMAIL_SCHEME=nullMAIL_HOST=127.0.0.1MAIL_PORT=2525MAIL_USERNAME=nullMAIL_PASSWORD=nullMAIL_FROM_ADDRESS="hello@example.com"MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=AWS_SECRET_ACCESS_KEY=AWS_DEFAULT_REGION=us-east-1AWS_BUCKET=AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="RAG Hub"RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v168 unmodified lines6970717268 unmodified lines
VITE_APP_NAME="${APP_NAME}"RAG_API_BASE_URL=https://lifedebugger-raghub-sevima-test.hf.space/api/v1RAG_CHAT_API_MODE=direct11 unmodified lines1213141515161711 unmodified lines/resources/js/wayfinder/vendor.DS_Store.env.env.backup.env.production.phpactor.json1234567891011121314456789151617182 unmodified lines2122231819202122232425262425262728293031323334353 unmodified lines39404136424344454647484942505144525354554656575859486061625051525354555663646566586768697071FROM php:8.4-cli
ENV 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
RUN apt-get update && apt-get install -y \ git \ unzip \ curl \ zip \ ca-certificates \ gnupg \ git unzip curl zip ca-certificates gnupg \ libzip-dev \ libpng-dev \ libjpeg-dev \2 unmodified lines libxml2-dev \ libsqlite3-dev \ && docker-php-ext-install \ zip \ pdo \ pdo_mysql \ pdo_sqlite \ mbstring \ exif \ pcntl \ bcmath \ gd \ 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/*3 unmodified linesRUN useradd -m -u 1000 user
ENV HOME=/home/userENV PORT=7860
RUN mkdir -p /home/user/app && chown user:user /home/user/app
COPY entrypoint.sh /entrypoint.shRUN chmod +x /entrypoint.sh
WORKDIR /home/user/app
COPY --chown=user:user . .USER user
COPY --chown=user:user entrypoint.sh /entrypoint.sh# PHP deps — cached unless composer.lock changesCOPY --chown=user:user composer.json composer.lock ./RUN composer install --no-dev --optimize-autoloader --no-interaction --no-scripts
RUN chmod +x /entrypoint.sh# Node deps — cached unless package-lock.json changesCOPY --chown=user:user package.json package-lock.json ./RUN npm ci
USER user# Source codeCOPY --chown=user:user . .
RUN composer install \ --no-dev \ --optimize-autoloader \ --no-interaction \ --no-scripts \ && php artisan package:discover --ansi \ && npm ci \RUN php artisan package:discover --ansi \ && php artisan config:clear \ && php artisan route:clear \ && npm run build \ && rm -rf node_modules && rm -rf node_modules \ && php artisan view:clear
EXPOSE 7860
123456789101112456789101112131415161718192021221415162324252627282919303132332 unmodified lines363738283930404142434445464748495051#!/bin/shset -e
for VAR_FILE in $(env | grep '_FILE=' | cut -d= -f1); do VAR_NAME="${VAR_FILE%_FILE}"
# kalau ENV biasa sudah ada, jangan overwrite if [ -n "$(printenv "$VAR_NAME")" ]; then continue fi
FILE_PATH=$(printenv "$VAR_FILE")if [ -f .env ]; then while IFS='=' read -r key value; do case "$key" in ''|\#*) continue ;; esac if [ -z "$(printenv "$key")" ]; then export "$key=$value" fi done < .envfi
env | while IFS='=' read -r KEY VALUE; do case "$KEY" in *_FILE) VAR_NAME="${KEY%_FILE}"
# kalau ENV biasa sudah ada jangan overwrite if [ -n "$(printenv "$VAR_NAME")" ]; then continue fi
if [ -n "$FILE_PATH" ] && [ -f "$FILE_PATH" ]; then export "$VAR_NAME=$(tr -d '\r\n' < "$FILE_PATH")" fi if [ -f "$VALUE" ]; then export "$VAR_NAME=$(tr -d '\r\n' < "$VALUE")" fi ;; esacdone
# HuggingFace compatibility# HF compatibilityif [ -n "$SPACE_HOST" ] && [ "${APP_URL:-}" = "http://localhost" ]; then export APP_URL="https://$SPACE_HOST"fi2 unmodified lines export ASSET_URL="https://$SPACE_HOST"fi
# Generate APP_KEY kalau belum adaif [ -z "${APP_KEY:-}" ]; then export APP_KEY=$(php artisan key:generate --show --no-interaction) APP_KEY="base64:$(openssl rand -base64 32)" export APP_KEY sed -i "s|^APP_KEY=.*|APP_KEY=${APP_KEY}|" .envfi
rm -f bootstrap/cache/config.php
php artisan config:clearphp artisan cache:clear
exec php artisan serve \ --host=0.0.0.0 \1094 unmodified lines109510961097109810981099110011011094 unmodified lines
return ( <> <Head title={currentSession?.title ?? 'RAG Hub'} /> <Head title={currentSession?.title ?? 'Chat'} />
<StudentShell activeSessionId={sessionId}101 unmodified lines102103104105105106107108101 unmodified lines
return ( <> <Head title="RAG Hub" /> <Head title="Beranda" />
<StudentShell chatSessions={chatSessions}3 unmodified lines4567789910111213141516171819202115 unmodified lines37383940413 unmodified linesimport react from '@vitejs/plugin-react';import laravel from 'laravel-vite-plugin';import { bunny } from 'laravel-vite-plugin/fonts';import { defineConfig } from 'vite';import { defineConfig, loadEnv } from 'vite';
export default defineConfig({export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '');
return { define: { 'import.meta.env.VITE_RAG_API_BASE_URL': JSON.stringify( env.VITE_RAG_API_BASE_URL || env.RAG_API_BASE_URL || process.env.VITE_RAG_API_BASE_URL || process.env.RAG_API_BASE_URL || '', ), }, plugins: [ laravel({ input: ['resources/css/app.css', 'resources/js/app.tsx'],15 unmodified lines formVariants: true, }), ], };});.dockerignore+1-1
.envAdded+66
.env.example-1
.gitignore-1
Dockerfile+38-28
entrypoint.sh+30-15
resources/js/pages/mahasiswa-chat.tsx+1-1
resources/js/pages/mahasiswa.tsx+1-1
vite.config.ts+12-2