Merge pull request 'To make it work with On Prem Data Ingest' (#8) from dsutanto/Deep-Package-Inspection:main into Proxy_Server_API_Netify
Reviewed-on: rafif/Deep-Package-Inspection#8
This commit was merged in pull request #8.
This commit is contained in:
commit
b961559651
6 files changed
+10102
-40
No files matched your search
+2
-2
@@ -1,10 +1,10 @@
|
||||
FROM node:18-alpine AS base
|
||||
FROM node:24-alpine AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci
|
||||
RUN npm ci --legacy-peer-deps
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM base AS builder
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
FROM oven/bun:1-alpine AS base
|
||||
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json .
|
||||
RUN bun install
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
ARG NEXT_PUBLIC_API_URL=http://127.0.0.1:3001
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN bun run build
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT 3000
|
||||
ENV HOSTNAME "0.0.0.0"
|
||||
|
||||
CMD ["bun", "run", "server.js"]
|
||||
@@ -40,7 +40,7 @@ function getBaseFilter(req, timeFilter = null) {
|
||||
|
||||
if (isGlobalUser && requestedSiteUuid) {
|
||||
filter.site_uuid = requestedSiteUuid;
|
||||
} else if (req.user?.site_uuid) {
|
||||
} else if (!isGlobalUser && req.user?.site_uuid) {
|
||||
filter.site_uuid = req.user.site_uuid;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS
|
||||
app.use(cors({
|
||||
origin: (origin, callback) => {
|
||||
if (!origin) return callback(null, true);
|
||||
if (ALLOWED_ORIGINS.includes(origin)) {
|
||||
if (ALLOWED_ORIGINS.includes('*') || ALLOWED_ORIGINS.includes(origin)) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
callback(new Error('Blocked by CORS policy (Unauthorized Origin)'));
|
||||
|
||||
Generated
+10098
File diff suppressed because it is too large.
Load diff
@@ -62,8 +62,3 @@ export async function POST(req: NextRequest) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Nonaktifkan body parser bawaan Next.js — biar formData diurus manual
|
||||
export const config = {
|
||||
api: { bodyParser: false },
|
||||
};
|
||||
Reference in new issue
Block a user