Skip to content
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

feat: optimize dockerfiles #226

Draft
wants to merge 3 commits into
base: prod
Choose a base branch
from
Draft

Conversation

pumbas600
Copy link
Collaborator

I was having issues building the original docker files. These also only include what's necessary so the images are MUCH smaller: ~1.6GB to 160 MB.

@pumbas600 pumbas600 marked this pull request as draft May 10, 2024 09:51
@pumbas600
Copy link
Collaborator Author

For some reason the initial NextJS request to get the current canvas info fails and I'm not sure why. I don't know if its because of my changes (presumably it is) or whether it just doesn't work locally in a dockerfile because I can't run the original ones 😓

Comment on lines +7 to +9
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently looks like PACKAGE_PATH is part of disabling Husky

Suggested change
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/backend
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/backend

Comment on lines +7 to +9
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/frontend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/frontend
# Disable Husky hooks https://typicode.github.io/husky/how-to.html#ci-server-and-docker
ENV HUSKY=0
ENV PACKAGE_PATH=packages/frontend

Comment on lines +29 to +31
ENV HUSKY=0
ENV NODE_ENV=production
ENV PACKAGE_PATH=packages/frontend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 29 and 31 are already set above, and NODE_ENV should be automatically set by NextJS

Comment on lines +33 to +34
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have uncommented it 🧐

Suggested change
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED 1

@@ -30,7 +30,7 @@
"format:fix": "pnpm --recursive format:fix",
"check": "pnpm --recursive check",
"check:fix": "pnpm --recursive check:fix",
"prepare": "husky",
"prepare": "husky || true",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?

Comment on lines +1 to +9
const path = require("node:path");

module.exports = {
output: "standalone",
experimental: {
// this includes files from the monorepo base two directories up
outputFileTracingRoot: path.join(__dirname, "../.."),
},
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const path = require("node:path");
module.exports = {
output: "standalone",
experimental: {
// this includes files from the monorepo base two directories up
outputFileTracingRoot: path.join(__dirname, "../.."),
},
};
const path = require("node:path");
const monorepoRoot = "../.."
module.exports = {
output: "standalone",
experimental: {
outputFileTracingRoot: path.join(__dirname, monorepoRoot),
},
};

Relatedly, would path.resolve() be better here?

@jaskfla
Copy link
Collaborator

jaskfla commented May 11, 2024

It could be nice to put the deployment scripts into /scripts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants