Skip to content

Commit

Permalink
chore: Next Standalone Config & Docker File
Browse files Browse the repository at this point in the history
  • Loading branch information
ByungJin-Lee committed May 15, 2023
1 parent c9594b3 commit 332099b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/club/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
reactStrictMode: true,
transpilePackages: ['@megabrain/core', '@megabrain/ui'],
output: 'standalone',
};

module.exports = nextConfig;
25 changes: 25 additions & 0 deletions dockerFiles/club.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:18-alpine AS base

# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /usr/src/app
COPY . .
RUN yarn install
RUN yarn build:club

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /usr/src/app

ENV NODE_ENV=production

RUN yarn global add pm2
COPY --from=builder /usr/src/app/apps/club/public ./public
COPY --from=builder /usr/src/app/apps/club/.next/standalone/apps/club ./
COPY --from=builder /usr/src/app/apps/club/.next/static ./.next/static

EXPOSE 3000

ENV PORT 300

Entrypoint ["pm2", "start", "server.js", "--name", "megabrain-club"];

0 comments on commit 332099b

Please sign in to comment.