-
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: Monorepo @megabrain/club Docker Build & Optimization
- Loading branch information
1 parent
332099b
commit ac82540
Showing
11 changed files
with
39 additions
and
176 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.3 MB
.yarn/cache/@esbuild-linux-arm64-npm-0.17.18-c613304d36-8076537841.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-29.8 KB
.yarn/cache/@next-eslint-plugin-next-npm-13.4.2-050788cd96-be6d258eed.zip
Binary file not shown.
Binary file renamed
BIN
+31.8 MB
...-darwin-arm64-npm-13.4.2-c805a6a575-8.zip → ...musl-npm-13.4.1-dd578a0b5b-442178a543.zip
Binary file not shown.
Binary file removed
BIN
-2.77 KB
.yarn/cache/eslint-config-next-npm-13.4.2-cc554a09f0-7967443d49.zip
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,25 +1,35 @@ | ||
FROM node:18-alpine AS base | ||
|
||
FROM base AS deps | ||
WORKDIR /usr/src/app | ||
|
||
COPY package.json yarn.lock .yarnrc.yml ./ | ||
COPY .yarn ./.yarn | ||
COPY packages ./packages | ||
COPY apps/club ./apps/club | ||
|
||
RUN yarn install; | ||
RUN rm -rf /usr/src/app/apps/club/.next/cache | ||
|
||
# Rebuild the source code only when needed | ||
FROM base AS builder | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN yarn install | ||
COPY --from=deps /usr/src/app . | ||
COPY .eslintrc.js .prettierrc . | ||
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 | ||
COPY --from=builder /usr/src/app/apps/club/.next/standalone ./ | ||
COPY --from=builder /usr/src/app/apps/club/.next/static ./apps/club/.next/static | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 300 | ||
# ENV PORT 3000 | ||
|
||
Entrypoint ["pm2", "start", "server.js", "--name", "megabrain-club"]; | ||
ENTRYPOINT ["pm2-runtime", "start", "./apps/club/server.js", "--env", "production"]; |
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,10 @@ | ||
**/.github | ||
**/.husky | ||
**/.idea | ||
**/.vscode | ||
**/.gitignore | ||
**/README.md | ||
**/node_modules | ||
**/.next | ||
apps | ||
!apps/club |
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
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