diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index ad0bbb8..71f9ef7 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -21,9 +21,6 @@ RUN bun install # Build the project COPY --from=prepare /app/out/full/ . -# Copy the rest of the source code -COPY --from=prepare /app/out/full/ . - ARG PUBLIC_CONVEX_URL ENV PUBLIC_CONVEX_URL=$PUBLIC_CONVEX_URL @@ -35,25 +32,31 @@ RUN bunx turbo build # Production stage FROM oven/bun:1-slim AS production -# Set working directory +# Set working directory to match builder structure WORKDIR /app # Create non-root user RUN addgroup --system --gid 1001 sveltekit RUN adduser --system --uid 1001 sveltekit -# Copy built application from base stage -COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/build ./build -COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/package.json ./package.json -# Copy node_modules from root (Bun manages workspaces centrally) -COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/node_modules ./node_modules +# Copy root node_modules (contains hoisted dependencies) +COPY --from=builder --chown=sveltekit:sveltekit /app/node_modules ./node_modules + +# Copy built application and workspace files +COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/build ./apps/web/build +COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/package.json ./apps/web/package.json +# Copy workspace node_modules (contains symlinks to root node_modules) +COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/node_modules ./apps/web/node_modules # Copy any additional files needed for runtime -COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/static ./static +COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/static ./apps/web/static # Switch to non-root user USER sveltekit +# Set working directory to the app +WORKDIR /app/apps/web + # Expose the port that the app runs on EXPOSE 5173 @@ -63,7 +66,7 @@ ENV PORT=5173 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD bun --version || exit 1 + CMD bun --version || exit 1 # Start the application CMD ["bun", "./build/index.js"] diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index c5e3bd5..d3107e2 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -1,16 +1,10 @@ -import tailwindcss from "@tailwindcss/vite"; -import { sveltekit } from "@sveltejs/kit/vite"; -import { defineConfig } from "vite"; +import tailwindcss from '@tailwindcss/vite'; +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; export default defineConfig({ plugins: [tailwindcss(), sveltekit()], resolve: { - dedupe: ["lucide-svelte"], - }, - optimizeDeps: { - exclude: ["lib-jitsi-meet"], // Excluir para permitir carregamento dinâmico no browser - }, - ssr: { - noExternal: [], // lib-jitsi-meet não funciona no SSR, deve ser carregada apenas no browser - }, + dedupe: ['lucide-svelte'] + } }); diff --git a/bun.lock b/bun.lock index cb8737c..56bacb1 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "": { "name": "sgse-app", "dependencies": { + "@convex-dev/better-auth": "^0.9.7", "@tanstack/svelte-form": "^1.23.8", "chart.js": "^4.5.1", "lucide-svelte": "^0.552.0", diff --git a/package.json b/package.json index 6748b71..4d32314 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "lucide-svelte": "^0.552.0", "prettier-plugin-svelte": "^3.4.0", "svelte-chartjs": "^3.1.5", - "svelte-sonner": "^1.0.5" + "svelte-sonner": "^1.0.5", + "@convex-dev/better-auth": "^0.9.7" }, "packageManager": "bun@1.3.0" -} \ No newline at end of file +} diff --git a/packages/backend/convex/_generated/api.d.ts b/packages/backend/convex/_generated/api.d.ts index 2559da4..770c2b4 100644 --- a/packages/backend/convex/_generated/api.d.ts +++ b/packages/backend/convex/_generated/api.d.ts @@ -9,7 +9,6 @@ */ import type * as actions_email from "../actions/email.js"; -import type * as actions_jitsiServer from "../actions/jitsiServer.js"; import type * as actions_linkPreview from "../actions/linkPreview.js"; import type * as actions_pushNotifications from "../actions/pushNotifications.js"; import type * as actions_smtp from "../actions/smtp.js"; @@ -69,7 +68,6 @@ import type { declare const fullApi: ApiFromModules<{ "actions/email": typeof actions_email; - "actions/jitsiServer": typeof actions_jitsiServer; "actions/linkPreview": typeof actions_linkPreview; "actions/pushNotifications": typeof actions_pushNotifications; "actions/smtp": typeof actions_smtp; diff --git a/turbo.json b/turbo.json index eadc42f..514423c 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,7 @@ "build": { "dependsOn": ["^build"], "inputs": ["$TURBO_DEFAULT$", ".env*"], - "outputs": ["dist/**"] + "outputs": ["build/**"] }, "lint": { "dependsOn": ["^lint"]