Skip to content

Commit b3a214d

Browse files
feat: initial CogniwareIms commit
- Add CogniwareIms project files - Clean history with only CogniwareIms-related changes - Removed all files outside CogniwareIms/ directory Signed-off-by: cogniware-devops <ambarish.desai@cogniware.ai>
0 parents  commit b3a214d

27 files changed

Lines changed: 10084 additions & 0 deletions
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Multi-stage build for Next.js production optimization
5+
FROM node:18-alpine AS base
6+
7+
# Install dependencies only when needed
8+
FROM base AS deps
9+
RUN apk add --no-cache libc6-compat
10+
WORKDIR /app
11+
12+
# Install dependencies (including dev dependencies for build)
13+
COPY frontend/package.json ./
14+
# Copy package-lock.json if it exists (wildcard makes it optional)
15+
COPY frontend/package-lock.json* ./
16+
# Use npm ci if lockfile exists and is valid, otherwise fall back to npm install
17+
RUN if [ -f package-lock.json ] && [ -s package-lock.json ]; then \
18+
npm ci --legacy-peer-deps || npm install; \
19+
else \
20+
echo "No valid package-lock.json found, using npm install"; \
21+
npm install; \
22+
fi
23+
24+
# Rebuild the source code only when needed
25+
FROM base AS builder
26+
WORKDIR /app
27+
COPY --from=deps /app/node_modules ./node_modules
28+
COPY frontend/ .
29+
30+
# Set environment variables
31+
ENV NEXT_TELEMETRY_DISABLED 1
32+
ENV NODE_ENV production
33+
34+
# Build Next.js
35+
RUN npm run build
36+
37+
# Production image, copy all the files and run next
38+
FROM base AS runner
39+
WORKDIR /app
40+
41+
ENV NODE_ENV production
42+
ENV NEXT_TELEMETRY_DISABLED 1
43+
44+
# Create non-root user
45+
RUN addgroup --system --gid 1001 nodejs
46+
RUN adduser --system --uid 1001 nextjs
47+
48+
# Copy necessary files
49+
COPY --from=builder /app/public ./public
50+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
51+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
52+
53+
USER nextjs
54+
55+
EXPOSE 3000
56+
57+
ENV PORT 3000
58+
ENV HOSTNAME "0.0.0.0"
59+
60+
# Health check
61+
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
62+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
63+
64+
CMD ["node", "server.js"]
65+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
html {
7+
scroll-behavior: smooth;
8+
}
9+
10+
body {
11+
@apply bg-white text-black;
12+
}
13+
}
14+
15+
@layer utilities {
16+
.text-balance {
17+
text-wrap: balance;
18+
}
19+
20+
/* Ripple animation for buttons */
21+
@keyframes ripple {
22+
0% {
23+
transform: scale(0);
24+
opacity: 1;
25+
}
26+
100% {
27+
transform: scale(4);
28+
opacity: 0;
29+
}
30+
}
31+
32+
.ripple {
33+
animation: ripple 0.6s ease-out;
34+
}
35+
36+
/* Loading progress bar animation */
37+
@keyframes loadProgress {
38+
from {
39+
width: 0%;
40+
}
41+
to {
42+
width: 100%;
43+
}
44+
}
45+
46+
.animate-progress {
47+
animation: loadProgress linear forwards;
48+
}
49+
}
50+
51+
/* Custom scrollbar */
52+
::-webkit-scrollbar {
53+
width: 8px;
54+
height: 8px;
55+
}
56+
57+
::-webkit-scrollbar-track {
58+
background: #f1f1f1;
59+
}
60+
61+
::-webkit-scrollbar-thumb {
62+
background: #888;
63+
border-radius: 4px;
64+
}
65+
66+
::-webkit-scrollbar-thumb:hover {
67+
background: #555;
68+
}
69+

0 commit comments

Comments
 (0)