-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Killed RAG feature #727
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,61 @@ | ||||||||||
FROM node:20-alpine AS base | ||||||||||
ENV PNPM_HOME="/pnpm" | ||||||||||
ENV PATH="$PNPM_HOME:$PATH" | ||||||||||
RUN apk add --no-cache libc6-compat && \ | ||||||||||
corepack enable | ||||||||||
|
||||||||||
WORKDIR /app | ||||||||||
|
||||||||||
# Install Turbo | ||||||||||
RUN pnpm add -g turbo@1.13.4 | ||||||||||
|
||||||||||
# Copy necessary files for turbo prune | ||||||||||
COPY . . | ||||||||||
|
||||||||||
# Prune the workspace | ||||||||||
RUN turbo prune --scope=webapp --docker | ||||||||||
|
||||||||||
# Installer stage | ||||||||||
FROM base AS installer | ||||||||||
WORKDIR /app | ||||||||||
|
||||||||||
# Copy pruned files | ||||||||||
COPY --from=base /app/out/json/ . | ||||||||||
COPY --from=base /app/out/pnpm-lock.yaml ./pnpm-lock.yaml | ||||||||||
COPY --from=base /app/out/full/ . | ||||||||||
|
||||||||||
# Install dependencies | ||||||||||
RUN pnpm install --shamefully-hoist | ||||||||||
|
||||||||||
# Build shared package first | ||||||||||
RUN cd packages/shared && pnpm run build | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use Using You can modify the Dockerfile like this: - RUN cd packages/shared && pnpm run build
+ WORKDIR /app/packages/shared
+ RUN pnpm run build If you need to return to the previous directory, you can add another
🧰 Tools🪛 Hadolint (2.12.0)[warning] 31-31: Use WORKDIR to switch to a directory (DL3003) |
||||||||||
|
||||||||||
# Build the webapp | ||||||||||
RUN pnpm run build --filter=webapp... | ||||||||||
|
||||||||||
# Runner stage | ||||||||||
FROM node:20-alpine AS runner | ||||||||||
WORKDIR /app | ||||||||||
|
||||||||||
# Don't run production as root | ||||||||||
RUN addgroup --system --gid 1001 nodejs | ||||||||||
RUN adduser --system --uid 1001 nextjs | ||||||||||
Comment on lines
+41
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Consolidate consecutive Combining multiple You can modify the commands as follows: - RUN addgroup --system --gid 1001 nodejs
- RUN adduser --system --uid 1001 nextjs
+ RUN addgroup --system --gid 1001 nodejs && \
+ adduser --system --uid 1001 nextjs 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Hadolint (2.12.0)[info] 42-42: Multiple consecutive (DL3059) |
||||||||||
|
||||||||||
# Copy necessary files | ||||||||||
COPY --from=installer /app/apps/webapp/.next/standalone ./ | ||||||||||
COPY --from=installer /app/apps/webapp/.next/static ./apps/webapp/.next/static | ||||||||||
COPY --from=installer /app/apps/webapp/public ./apps/webapp/public | ||||||||||
|
||||||||||
# Copy package.json files | ||||||||||
COPY --from=installer /app/apps/webapp/package.json ./package.json | ||||||||||
|
||||||||||
# Install only production dependencies | ||||||||||
|
||||||||||
Comment on lines
+52
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Remove or update the comment about installing production dependencies The comment If no action is needed here, consider removing the comment: - # Install only production dependencies Alternatively, if you need to install production dependencies, add the appropriate command after the comment. 📝 Committable suggestion
Suggested change
|
||||||||||
USER nextjs | ||||||||||
|
||||||||||
ENV NODE_ENV=production | ||||||||||
ENV PORT=8090 | ||||||||||
|
||||||||||
EXPOSE 8090 | ||||||||||
|
||||||||||
CMD ["node", "server.js"] |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,12 @@ | ||||||||||
/** @type {import('next').NextConfig} */ | ||||||||||
import path from 'path'; | ||||||||||
import { fileURLToPath } from 'url'; | ||||||||||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use the For better clarity and explicit identification of Node.js built-in modules, use the -import path from 'path';
-import { fileURLToPath } from 'url';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url'; 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 2-2: A Node.js builtin module should be imported with the node: protocol. Using the node: protocol is more explicit and signals that the imported module belongs to Node.js. (lint/style/useNodejsImportProtocol) [error] 3-3: A Node.js builtin module should be imported with the node: protocol. Using the node: protocol is more explicit and signals that the imported module belongs to Node.js. (lint/style/useNodejsImportProtocol) |
||||||||||
|
||||||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||||||||||
|
||||||||||
const nextConfig = { | ||||||||||
output: 'standalone', | ||||||||||
outputFileTracingRoot: path.join(__dirname, '../../'), | ||||||||||
async redirects() { | ||||||||||
return [ | ||||||||||
{ | ||||||||||
|
@@ -12,4 +18,4 @@ const nextConfig = { | |||||||||
} | ||||||||||
}; | ||||||||||
|
||||||||||
export default nextConfig; | ||||||||||
export default nextConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Pin versions in
apk add
command for reproducible buildsTo ensure reproducible builds and prevent unexpected issues from package updates, it's recommended to pin the versions when installing packages with
apk add
.You can modify the command as follows:
Replace
<version>
with the specific version number required.🧰 Tools
🪛 Hadolint (2.12.0)
[warning] 4-4: Pin versions in apk add. Instead of
apk add <package>
useapk add <package>=<version>
(DL3018)