diff --git a/.github/workflows/docker-ci-cd.yml b/.github/workflows/docker-ci-cd.yml index ea68b31..bd6ef8d 100644 --- a/.github/workflows/docker-ci-cd.yml +++ b/.github/workflows/docker-ci-cd.yml @@ -128,7 +128,7 @@ jobs: - name: Set up Bun uses: oven-sh/setup-bun@v1 with: - bun-version: latest + bun-version: '1.2.0' - name: Cache Bun dependencies uses: actions/cache@v3 diff --git a/Dockerfile b/Dockerfile index cf63ff4..ed2bd5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,32 +3,32 @@ # Base stage FROM oven/bun:canary-alpine AS builder -# Set build arguments +# Set build arguments first since they rarely change ARG BUILD_VERSION=development ARG COMMIT_HASH=unknown ARG BUILD_DATE -ARG NODE_ENV=production +ARG NODE_ENV=development -# Set environment variables +# Set as environment variables for build process ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT_HASH=${COMMIT_HASH} ENV BUILD_DATE=${BUILD_DATE} ENV NODE_ENV=${NODE_ENV} -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 -ENV LC_CTYPE=C.UTF-8 WORKDIR /app -# Copy package files and install dependencies +# Copy package files first for better cache utilization COPY package.json bun.lockb ./ RUN --mount=type=cache,target=/root/.bun/install/cache \ bun install --frozen-lockfile -# Copy all files and build the application +# Copy all files after dependency installation COPY . . -RUN --mount=type=cache,target=/root/.bun/install/cache \ - bun run svelte-kit sync && \ + +# Build the application +RUN bun run svelte-kit sync && \ + NODE_ENV=${NODE_ENV} \ + DISABLE_OPENTELEMETRY=true \ bun run build:no-telemetry # Production image @@ -40,23 +40,21 @@ ARG COMMIT_HASH ARG BUILD_DATE ARG NODE_ENV -# Set environment variables for runtime +# Set as environment variables for runtime ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT_HASH=${COMMIT_HASH} ENV BUILD_DATE=${BUILD_DATE} ENV NODE_ENV=${NODE_ENV} -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 -ENV LC_CTYPE=C.UTF-8 WORKDIR /app # Copy everything from builder COPY --from=builder /app/ ./ -# Install production dependencies +# Install production dependencies with cache RUN --mount=type=cache,target=/root/.bun/install/cache \ bun install --production --frozen-lockfile && \ + mkdir -p src/data && \ chown -R bun:bun /app USER bun diff --git a/bun.lockb b/bun.lockb index 836f957..3bce7d9 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index a4d9291..bf4aa66 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@sveltejs/adapter-auto": "^4.0.0", "@sveltejs/adapter-node": "^5.2.11", "@sveltejs/kit": "^2.15.3", - "@sveltejs/vite-plugin-svelte": "^3.0.3", + "@sveltejs/vite-plugin-svelte": "^5.0.3", "@tailwindcss/forms": "^0.5.10", "@types/bun": "^1.1.16", "@types/node": "^22.10.7", @@ -49,15 +49,15 @@ "bun-types": "^1.1.43", "postcss": "^8.5.1", "process": "^0.11.10", - "svelte": "^5.19.0", + "svelte": "^5.18.0", "svelte-adapter-bun": "^0.5.2", "svelte-check": "^4.1.4", "tailwindcss": "^3.4.17", "typescript": "^5.7.3", - "vite": "^5.4.14" + "vite": "^6.0.7" }, "dependencies": { - "@apollo/client": "3.11.0", + "@apollo/client": "^3.12.8", "@azure/identity": "^4.6.0", "@azure/msal-browser": "^4.0.1", "@azure/msal-node": "^3.0.1", @@ -70,7 +70,7 @@ "@openreplay/tracker-graphql": "^4.1.0", "@openreplay/tracker-profiler": "^3.0.1", "@opentelemetry/api": "^1.9.0", - "@opentelemetry/auto-instrumentations-node": "^0.55.2", + "@opentelemetry/auto-instrumentations-node": "^0.56.0", "@opentelemetry/context-zone": "^1.30.1", "@opentelemetry/core": "^1.30.1", "@opentelemetry/exporter-logs-otlp-http": "^0.57.1", @@ -106,7 +106,7 @@ "mode-watcher": "^0.5.0", "net": "^1.0.2", "node-cron": "^3.0.3", - "openai": "^4.78.1", + "openai": "^4.81.0", "os": "^0.1.2", "papaparse": "^5.5.1", "svelte-sonner": "^0.3.28",