-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add docker file, docker-compose, and env changes #624
Conversation
Preview uploaded to https://preview.dashboard.test.threshold.network/docker/index.html. |
Hey @theref, thanks for opening this up! Can you include in the PR description some context (what the change is and why you're making it), testing procedures, and a screenshot of docker running beautifully in the console? It doesn't have to be too in-depth, but it's nice for our future selves to have the record :D |
Preview uploaded to https://preview.dashboard.test.threshold.network/docker/index.html. |
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 had some troubles running the docker-compose command. Maybe these changes can help to make it more clear.
Preview uploaded to https://preview.dashboard.test.threshold.network/docker/index.html. |
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.
LGTM 🙌
@theref , looks good. Couple questions:
|
This still requires a lot of system resources, beware!
…lect local filesystem changes during development Co-authored-by: James Campbell <[email protected]>
Co-authored-by: Manuel Montenegro <[email protected]>
This PR is no longer ready as the build is no longer successful. There seems to have been a lot of changes in upstream packages that are causing issues here. I am attempting to narrow them down. As I make discoveries I will continue to post them here. EDIT - fixed |
This still requires a lot of system resources, beware!
…lect local filesystem changes during development Co-authored-by: James Campbell <[email protected]>
Co-authored-by: Manuel Montenegro <[email protected]>
- "3000:3000" | ||
volumes: | ||
- .:/app # Bind mount the current directory to /app in the container | ||
- /app/node_modules # This will prevent node_modules from being overwritten by the local volume |
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.
Adding node_modules
to .dockerignore
instead would also have an additional benefit of a smaller build context. (Even thought we don't COPY
it, docker
still has to index it before starting a build process).
environment: | ||
- PYTHON=/usr/bin/python3 | ||
- NODE_OPTIONS=--max_old_space_size=3072 |
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.
We've already set these up in Dockerfile.dev
. Any reason why we set these in two different places?
|
||
# Set the environment variables | ||
ENV PYTHON=/usr/bin/python3 | ||
ENV NODE_OPTIONS=--max_old_space_size=3072 |
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.
Could we document the motivation for using this Node.js flag?
@@ -0,0 +1,22 @@ | |||
# Use the specified image | |||
FROM node:14-buster-slim |
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.
Node.js 14 has already reached the end-of-life, and Node.js 16 is going to reach EOL shortly.
I suggest using node:16-buster-slim
since it looks from the contents of package.json
"@types/node": "^16.9.1",
FROM node:14-buster-slim | |
FROM node:16-buster-slim |
We can address transition from 16 to 18 (the next LTS version) in another PR.
You may want to consider using multistage builds to slightly speed up the building process. Not sure if this is helpful here, just dropping a hint:
|
replaced by #625 |
This is an attempt to simplify the dev process for newcomers. To test, follow the instructions in the README regarding updating
package.json
and.env
, then:docker-compose run --build
. First build will take a while, but after that should be very quick.Example logs can be seen here https://app.warp.dev/block/qnf8YCpPJIuxvSQRwnRJ1i