diff --git a/.env.example b/.env.example index 58821a8..a45ab05 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,11 @@ OPENAI_API_KEY=sk-... # ===== Database (Local Dev) ===== # Production uses Supabase Postgres DATABASE_URL=postgresql://postgres:postgres@localhost:5432/enterprise_rag +SERVER_DB_POOL_SIZE=3 +SERVER_DB_MAX_OVERFLOW=2 +WORKER_DB_POOL_SIZE=1 +WORKER_DB_MAX_OVERFLOW=0 +DB_POOL_TIMEOUT_SECONDS=30 # ===== Redis (Required for queue + cache) ===== REDIS_URL=redis://localhost:6379/0 diff --git a/.github/trivy/Dockerfile b/.github/trivy/Dockerfile index 2028c59..51c4af7 100644 --- a/.github/trivy/Dockerfile +++ b/.github/trivy/Dockerfile @@ -1 +1,8 @@ FROM aquasec/trivy:0.70.0 + +RUN adduser -D trivyuser \ + && mkdir -p /home/trivyuser/.cache/trivy \ + && chown -R trivyuser:trivyuser /home/trivyuser + +ENV HOME=/home/trivyuser +USER trivyuser diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ac51b8b..01c3a5d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,6 +35,7 @@ jobs: - name: Run Trivy FS Scan run: | docker run --rm \ + --user root \ -v "${{ github.workspace }}:/workspace" \ -w /workspace \ local-trivy fs . \ diff --git a/client/Dockerfile b/client/Dockerfile index 96396e1..46d786f 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -23,7 +23,10 @@ RUN npm run build # Production stage FROM nginx:alpine AS production -COPY --from=build /app/dist /usr/share/nginx/html +COPY --from=build --chown=nginx:nginx /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 +RUN touch /var/run/nginx.pid \ + && chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid /usr/share/nginx/html +USER nginx +EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] diff --git a/client/nginx.conf b/client/nginx.conf index 84fa1c0..d4f2f14 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 8080; server_name _; root /usr/share/nginx/html; index index.html; diff --git a/client/src/components/chat/ChatSessionList.tsx b/client/src/components/chat/ChatSessionList.tsx index 095c67f..9fb957f 100644 --- a/client/src/components/chat/ChatSessionList.tsx +++ b/client/src/components/chat/ChatSessionList.tsx @@ -38,9 +38,11 @@ export default function ChatSessionList({ {!loading && items.length === 0 ?
No saved chats yet.
: null}