Merge pull request #50 from killer-cf/config-self-convex

Config self convex
This commit is contained in:
Kilder Costa
2025-11-27 15:34:01 -03:00
committed by GitHub
6 changed files with 24 additions and 27 deletions

View File

@@ -21,9 +21,6 @@ RUN bun install
# Build the project # Build the project
COPY --from=prepare /app/out/full/ . COPY --from=prepare /app/out/full/ .
# Copy the rest of the source code
COPY --from=prepare /app/out/full/ .
ARG PUBLIC_CONVEX_URL ARG PUBLIC_CONVEX_URL
ENV PUBLIC_CONVEX_URL=$PUBLIC_CONVEX_URL ENV PUBLIC_CONVEX_URL=$PUBLIC_CONVEX_URL
@@ -35,25 +32,31 @@ RUN bunx turbo build
# Production stage # Production stage
FROM oven/bun:1-slim AS production FROM oven/bun:1-slim AS production
# Set working directory # Set working directory to match builder structure
WORKDIR /app WORKDIR /app
# Create non-root user # Create non-root user
RUN addgroup --system --gid 1001 sveltekit RUN addgroup --system --gid 1001 sveltekit
RUN adduser --system --uid 1001 sveltekit RUN adduser --system --uid 1001 sveltekit
# Copy built application from base stage # Copy root node_modules (contains hoisted dependencies)
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/build ./build COPY --from=builder --chown=sveltekit:sveltekit /app/node_modules ./node_modules
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/package.json ./package.json
# Copy node_modules from root (Bun manages workspaces centrally) # Copy built application and workspace files
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/node_modules ./node_modules 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 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 # Switch to non-root user
USER sveltekit USER sveltekit
# Set working directory to the app
WORKDIR /app/apps/web
# Expose the port that the app runs on # Expose the port that the app runs on
EXPOSE 5173 EXPOSE 5173
@@ -63,7 +66,7 @@ ENV PORT=5173
# Health check # Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD bun --version || exit 1 CMD bun --version || exit 1
# Start the application # Start the application
CMD ["bun", "./build/index.js"] CMD ["bun", "./build/index.js"]

View File

@@ -1,16 +1,10 @@
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from "@sveltejs/kit/vite"; import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from "vite"; import { defineConfig } from 'vite';
export default defineConfig({ export default defineConfig({
plugins: [tailwindcss(), sveltekit()], plugins: [tailwindcss(), sveltekit()],
resolve: { resolve: {
dedupe: ["lucide-svelte"], 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
},
}); });

View File

@@ -5,6 +5,7 @@
"": { "": {
"name": "sgse-app", "name": "sgse-app",
"dependencies": { "dependencies": {
"@convex-dev/better-auth": "^0.9.7",
"@tanstack/svelte-form": "^1.23.8", "@tanstack/svelte-form": "^1.23.8",
"chart.js": "^4.5.1", "chart.js": "^4.5.1",
"lucide-svelte": "^0.552.0", "lucide-svelte": "^0.552.0",

View File

@@ -42,7 +42,8 @@
"lucide-svelte": "^0.552.0", "lucide-svelte": "^0.552.0",
"prettier-plugin-svelte": "^3.4.0", "prettier-plugin-svelte": "^3.4.0",
"svelte-chartjs": "^3.1.5", "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" "packageManager": "bun@1.3.0"
} }

View File

@@ -9,7 +9,6 @@
*/ */
import type * as actions_email from "../actions/email.js"; 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_linkPreview from "../actions/linkPreview.js";
import type * as actions_pushNotifications from "../actions/pushNotifications.js"; import type * as actions_pushNotifications from "../actions/pushNotifications.js";
import type * as actions_smtp from "../actions/smtp.js"; import type * as actions_smtp from "../actions/smtp.js";
@@ -69,7 +68,6 @@ import type {
declare const fullApi: ApiFromModules<{ declare const fullApi: ApiFromModules<{
"actions/email": typeof actions_email; "actions/email": typeof actions_email;
"actions/jitsiServer": typeof actions_jitsiServer;
"actions/linkPreview": typeof actions_linkPreview; "actions/linkPreview": typeof actions_linkPreview;
"actions/pushNotifications": typeof actions_pushNotifications; "actions/pushNotifications": typeof actions_pushNotifications;
"actions/smtp": typeof actions_smtp; "actions/smtp": typeof actions_smtp;

View File

@@ -5,7 +5,7 @@
"build": { "build": {
"dependsOn": ["^build"], "dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"], "inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**"] "outputs": ["build/**"]
}, },
"lint": { "lint": {
"dependsOn": ["^lint"] "dependsOn": ["^lint"]