-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added Dockerfile and docker-compose for local setup #72
base: main
Are you sure you want to change the base?
Conversation
…osting-configuration
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.
@@ -0,0 +1,11 @@ | |||
FROM node:20-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.
Perhaps this is all good, but not sure if we should change anything here based on our .nvmrc
file: https://github.com/namehash/ensnode/blob/main/.nvmrc or the version of node referenced in our root package.json: https://github.com/namehash/ensnode/blob/main/package.json#L38-L40
Ideally these would all be in total alignment.
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 believe we should support the oldest version possible, but use the active LTS version. There's no point in voluntarily using outdated software.
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.
agree this should be 18
for now, but truthfully we should be able to update everything to run on 20. if we do so we'll want to do that as a single pr, updating nvmrc, engines fields, and docker bases at once. i've added an issue for that in the prject.
- postgres | ||
|
||
postgres: | ||
image: postgres:15 |
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.
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.
def should be 16, could be even later, but let's stay with 16 for now
@@ -0,0 +1,28 @@ | |||
services: | |||
|
|||
indexer: |
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.
indexer: | |
ensnode: |
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.
agree, call it ensnode
for now, but imo we'll rename the ensnode service to something like indexer
or onchain-indexer
in the future, since ensnode is now the collection of services. i've added an issue to track this as well.
ports: | ||
- "8080:42069" | ||
env_file: | ||
- .env.docker |
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.
Would using the .env.local
file work here? It was meant to be loaded in to the indexer runtime. Let me know what you think 🙃
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.
agree, would like to know reason for .env.docker
@shrugs Also I remember you shared some concerns 1-2 weeks about about us introducing Docker into the project at that time. Do you still have a concern on that? If so, could you please share more details with your advice and suggestions? Much appreciated! Thanks! Sebastian will be on holiday for the coming week. @shrugs @tk-o If either of you guys have suggestions for the general direction @BanaSeba takes here, please share advice in a comment. Please also note the advice I already shared with @BanaSeba in this Slack thread: https://namehash.slack.com/archives/C086Z6FNBHN/p1737717125731929 |
project is now multi-service, so docker is fine solution. i still worry about logistics-creep but it's the right time to add |
@@ -0,0 +1 @@ | |||
.env* |
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.
editor EOF configuration, please automatically include newlines on save
|
||
volumes: | ||
postgres_data: | ||
driver: local |
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.
editor EOF
RUN pnpm install --prod --frozen-lockfile | ||
|
||
EXPOSE 8000 | ||
CMD [ "pnpm", "start" ] |
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.
editor EOF
|
||
RUN pnpm install --prod --frozen-lockfile | ||
|
||
EXPOSE 8000 |
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.
expose 8000 here but mapping 8080:42069
in compose?
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8080:42069" |
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.
can we rely on the ponder defaults and instead of specifying a port to that container we just map 42069:42069
?
ports: | ||
- "8080:42069" | ||
env_file: | ||
- .env.docker |
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.
agree, would like to know reason for .env.docker
@@ -12,6 +12,8 @@ yarn-error.log* | |||
|
|||
# Env files | |||
.env*.local | |||
.env.docker | |||
.env |
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.
shouldn't need .env file, use .env.local
@BanaSeba Hey, while you were on holiday this week we've moved to a monorepo and also created a docker setup for the new ensrainbow app. How do you suggest we take next steps here now? |
No description provided.