-
Notifications
You must be signed in to change notification settings - Fork 142
Feat: dockerfile to build the app #632
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
Open
dylanflandpro
wants to merge
10
commits into
main
Choose a base branch
from
feat/dockerfile-start-ui-v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+124
−0
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
493d45f
WIP add dockerfile (7/7 but missing files)
dylanflandpro f906345
WIP building working
dylanflandpro 39b5d55
set config for database
dylanflandpro 16a2e4b
WIP feedback
dylanflandpro a0ab4c7
fix: remove command in package.json and update readme.md
dylanflandpro 8312773
fix readme dockerfile syntax on example
dylanflandpro 1e9c8a3
clear and add comments
dylanflandpro 7e07566
copying node_modules instead of reinstalling them
dylanflandpro 11550fe
Use var env instead of .env file
dylanflandpro a1b0ad2
missing letter in installation dependencies
dylanflandpro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,59 @@ | ||
| # Stage 1: builder | ||
| FROM node:22-alpine AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # install pnpm & git | ||
| RUN npm install -g pnpm | ||
| RUN apk update && \ | ||
| apk upgrade && \ | ||
| apk add --no-cache git | ||
|
|
||
| RUN git init | ||
dylanflandpro marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| # copy lock, package files and configs | ||
| COPY package.json pnpm-lock.yaml ./ | ||
| COPY run-jiti.js ./ | ||
| COPY src/features/build-info/script-to-generate-json.ts src/features/build-info/build-info.gen.json ./src/features/build-info/ | ||
| COPY prisma/schema.prisma ./prisma/ | ||
|
|
||
| RUN pnpm install --frozen-lockfile | ||
|
|
||
| # copy source | ||
| COPY . . | ||
|
|
||
| ENV NODE_OPTIONS=--max-old-space-size=4096 | ||
|
|
||
| # build app | ||
| RUN pnpm build | ||
|
|
||
|
|
||
| # Stage 2: runtime | ||
| FROM node:22-alpine AS runtime | ||
|
|
||
|
|
||
| WORKDIR /app | ||
|
|
||
| # ENV | ||
| ENV NODE_ENV=production | ||
| ENV HOST=0.0.0.0 | ||
| ENV PORT=3000 | ||
|
|
||
| # install pnpm | ||
| RUN npm install -g pnpm npm-run-all | ||
|
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. Why is 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. run-p not found if I don't install npm run all |
||
|
|
||
| COPY .env ./ | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
|
|
||
| ## copy output build and package.json from builder | ||
| COPY --from=builder /app/.output ./.output | ||
| COPY --from=builder /app/package.json ./package.json | ||
| COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml | ||
| RUN pnpm install --frozen-lockfile | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| # start | ||
| CMD ["pnpm", "start"] | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.