Skip to content

Commit 946ccf5

Browse files
authored
fix/build issues (#6)
Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>
1 parent f472a0e commit 946ccf5

6 files changed

Lines changed: 36 additions & 231 deletions

File tree

Dockerfile

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
FROM node:18-slim as build
2-
RUN npm install -g pnpm
1+
# ---------------------
2+
# Build stage
3+
# ---------------------
4+
FROM oven/bun:1.3.3-alpine AS build
35

46
WORKDIR /app
5-
COPY package.json ./
7+
8+
# Copy dependency manifests
9+
COPY package.json bun.lock ./
10+
11+
# Install dependencies
12+
RUN bun install
13+
14+
# Copy source
615
COPY . .
7-
RUN pnpm install
8-
RUN pnpm run build
916

10-
# Stage 2
11-
FROM node:18-slim as prod
17+
# Build Next.js app
18+
RUN bun --bun run build
19+
20+
21+
# ---------------------
22+
# Production stage
23+
# ---------------------
24+
FROM oven/bun:1.3.3-alpine AS production
1225

13-
RUN npm install -g pnpm
26+
# Create non-root user
27+
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
1428

1529
WORKDIR /app
30+
31+
# Copy required runtime files
1632
COPY --from=build /app/node_modules ./node_modules
1733
COPY --from=build /app/package.json ./
1834
COPY --from=build /app/.next ./.next
1935
COPY --from=build /app/public ./public
2036
COPY --from=build /app/src/app ./src/app
2137
COPY --from=build /app/next.config.mjs ./next.config.mjs
38+
39+
# Fix ownership
40+
RUN chown -R appuser:appgroup /app
41+
42+
USER appuser
43+
2244
EXPOSE 3001
23-
CMD [ "pnpm", "run" ,"start"]
45+
46+
# Start Next.js
47+
CMD ["bun", "run", "start"]

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start -p 3001",
6+
"dev": "bun run --bun next dev",
7+
"build": "bun run --bun next build",
8+
"start": "bun run --bun next start -p 3001",
99
"lint": "next lint"
1010
},
1111
"dependencies": {

src/components/LocaleSwitcher.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/components/LocaleSwitcherSelect.tsx

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/components/appLauncher.tsx

Lines changed: 0 additions & 114 deletions
This file was deleted.

src/lib/organizationSlice.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
22

3-
import { OrgAgentdetails } from "@/utils/common.interfaces";
43

54
interface SelectedOrgnization{
65
orgId: string;
76
orgName: string;
87
orgLogo: string;
9-
orgAgent: OrgAgentdetails[]|[];
108
appLaunchDetails?:[{}]
119
}
1210
interface OrganizationState {

0 commit comments

Comments
 (0)