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: Add Docker setup #9

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: Add Docker setup #9

wants to merge 2 commits into from

Conversation

cyberglot
Copy link
Contributor

@cyberglot cyberglot commented Oct 24, 2024

This PR adds a Docker setup for users having problems meeting the requirements to run a nillion app.

  • Docker setup
  • Docker write-up to help users understand the basic building blocks
  • Update tree structure in the readme to reflect docker-related files

@@ -11,14 +11,14 @@
"test": "jest",
"format": "prettier --write \"**/*.{js,ts,json,md}\"",
"prepare": "husky",
"lint": "eslint . --fix",
"lint": "eslint src --fix",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, it was trying to lint the code generated in dist/ ?

Comment on lines +36 to +45
rl.question(dockerMessage, (answer) => {
rl.close();
const yesOrNo = answer.trim() || "nillion-quickstart";
if (/y|yes|n|no/.test(yesOrNo)) {
resolve(yesOrNo === "y" || yesOrNo === "yes");
} else {
console.log("Using default: no Docker container.");
resolve(false);
}
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to replace this part of the code with something more robust like prompt.js or inquirer.js!

@@ -19,3 +19,5 @@ export const installDependencies = async () => {
});
console.log("Dependencies installed successfully.");
};

export const installRepoPackage = installDependencies("npm", ["install"]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I abstracted the commands passed in, but didn't use it in the end. Maybe I should undo this work, idk.

<%= it.projectName %>:
restart: always
environment:
- WATCHPACK_POLLING=true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for Windows users, but I am not sure if it works because I don't have a Windows machine.


EXPOSE 3000
ENV PORT=3000
CMD ["sh"]
Copy link
Contributor Author

@cyberglot cyberglot Oct 24, 2024

Choose a reason for hiding this comment

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

In some case, users may want to run commands inside the Docker container, now they easily can.

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.

1 participant