-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Next Standalone Config & Docker File
- Loading branch information
1 parent
c9594b3
commit 332099b
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; |