Skip to content

Commit bdbbd57

Browse files
committed
nextjs using clustering
1 parent 2cbbaf8 commit bdbbd57

File tree

9 files changed

+1518
-184
lines changed

9 files changed

+1518
-184
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bld/
3131
[Bb]in/
3232
[Oo]bj/
3333
[Ll]og/
34+
dist/
3435

3536
# Visual Studio 2015 cache/options directory
3637
.vs/

src/BenchmarksApps/TechEmpower/nextjs/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ COPY . .
2626
# Uncomment the following line in case you want to disable telemetry during the build.
2727
ENV NEXT_TELEMETRY_DISABLED 1
2828

29-
RUN yarn build
29+
#RUN yarn build
3030

3131
# If using npm comment out above and use below instead
32-
# RUN npm run build
32+
RUN npm run build
3333

3434
# Production image, copy all the files and run next
3535
FROM base AS runner
@@ -46,7 +46,7 @@ COPY --from=builder /app/public ./public
4646

4747
# Automatically leverage output traces to reduce image size
4848
# https://nextjs.org/docs/advanced-features/output-file-tracing
49-
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
49+
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
5050
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
5151

5252
USER nextjs
@@ -56,4 +56,4 @@ EXPOSE 3000
5656
ENV PORT 3000
5757
ENV DB_HOST postgres_te
5858

59-
CMD ["node", "server.js"]
59+
CMD ["node", "dist/server.js"]

src/BenchmarksApps/TechEmpower/nextjs/app/fortunes/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ export default async function Page() {
77
const data = await db.getFortunes();
88
return (
99
<table>
10-
<>
10+
<tbody>
1111
<tr><th>id</th><th>message</th></tr>
1212
{data.map((row, idx) =>
1313
<tr key={idx}><td>{row.id}</td><td>{row.message}</td></tr>
1414
)}
15-
</>
15+
</tbody>
1616
</table>
1717
)
1818
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/** @type {import('next').NextConfig} */
22
module.exports = {
3-
output: 'standalone',
4-
reactStrictMode: true
3+
reactStrictMode: true,
54
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"watch": ["server.ts"],
3+
"exec": "ts-node --project tsconfig.server.json server.ts",
4+
"ext": "js ts"
5+
}

0 commit comments

Comments
 (0)