-
Notifications
You must be signed in to change notification settings - Fork 7
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
Reduce-docker-buildtime #1970
Draft
kcirtapfromspace
wants to merge
7
commits into
main
Choose a base branch
from
reduce-docker-buildtime
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.
Draft
Reduce-docker-buildtime #1970
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06fe140
use multistage builds
kcirtapfromspace 7d7f3c1
Updates to dev system
kcirtapfromspace 83acbaf
minor
kcirtapfromspace 6589170
get docker working
kcirtapfromspace 6ada27b
minor
kcirtapfromspace 2bb8802
move ci/cd components to their own layer
kcirtapfromspace 110058c
Add mount directy for yarn cache.
kcirtapfromspace 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
.dockerignore | ||
Dockerfile | ||
Dockerfile.* | ||
docker-compose.* | ||
node_modules | ||
docker-compose.yaml | ||
docker-compose.yaml | ||
similarity_api/ | ||
docs/ | ||
bin/ | ||
deployment_config/ | ||
terraform/ | ||
**/node_modules | ||
**/.next | ||
**/dist | ||
*.md | ||
reports | ||
.env |
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 |
---|---|---|
|
@@ -14,7 +14,8 @@ tests/e2e/report | |
/doc | ||
|
||
# Build related | ||
build/ | ||
build/** | ||
dist/** | ||
frontend/build | ||
node_modules | ||
|
||
|
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,59 @@ | ||
FROM node:18.18.2 as base | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init lcov chromium | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ | ||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser | ||
COPY package.json yarn.lock ./ | ||
RUN yarn global add node-gyp &&\ | ||
yarn install &&\ | ||
yarn cache clean | ||
|
||
FROM node:18.18.2-alpine as frontend-base | ||
WORKDIR /app | ||
RUN apk update && apk add yarn dumb-init | ||
COPY frontend/package.json frontend/yarn.lock ./ | ||
RUN yarn install &&\ | ||
yarn cache clean | ||
|
||
FROM node:18.18.2 as build | ||
ENV NODE_OPTIONS=--max_old_space_size=2048 | ||
WORKDIR /app | ||
COPY --from=base /app/node_modules /app/node_modules | ||
COPY --from=base /app/package.json /app/package.json | ||
COPY src/ /app/src/ | ||
COPY tests/ /app/tests/ | ||
COPY config/ /app/config/ | ||
RUN yarn tsc --build --verbose src | ||
|
||
FROM node:18.18.2-alpine as frontend-build | ||
ENV NODE_OPTIONS=--max_old_space_size=2048 | ||
WORKDIR /app | ||
ENV DISABLE_ESLINT_PLUGIN=true | ||
COPY --from=frontend-base /app/node_modules /app/node_modules | ||
COPY ./frontend . | ||
RUN yarn build:local | ||
|
||
FROM node:18.18.2-alpine as frontend | ||
RUN apk update | ||
# ENV CHOKIDAR_USEPOLLING=true | ||
WORKDIR /app | ||
COPY --chown=node:node --from=frontend-base /usr/bin/dumb-init /usr/bin/dumb-init | ||
COPY --chown=node:node --from=frontend-build /app/build /app | ||
COPY --chown=node:node --from=frontend-build /app/node_modules /app/node_modules | ||
COPY --chown=node:node --from=frontend-build /app/package.json /app/package.json | ||
USER node | ||
# CMD ["/usr/bin/dumb-init", "node", "server.js"] | ||
|
||
FROM node:18.18.2-slim as backend | ||
WORKDIR /app | ||
COPY --chown=node:node .sequelizerc /app/.sequelizerc | ||
COPY --chown=node:node --from=base /usr/bin/dumb-init /usr/bin/dumb-init | ||
COPY --chown=node:node --from=build /app/build /app | ||
COPY --chown=node:node --from=build /app/node_modules/ /app/node_modules/ | ||
COPY --chown=node:node --from=build /app/package.json /app/package.json | ||
USER node | ||
# CMD ["dumb-init", "node", "server.js"] | ||
|
||
FROM backend as worker | ||
|
||
FROM backend as testingonly |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker_compose(["./docker-compose.yml", "./docker-compose.override.yml"]) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you using turbo somewhere? don't see it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no,
left over from taking a peek at https://turbo.build/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it looks cool, our JS build tooling is definitely behind the ecosystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have some content on getting it added in to existing work https://turbo.build/repo/docs/getting-started/existing-monorepo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to get the frontend to build & cache easily enough.
#1973