Closed jschr closed 7 years ago
So if nodemon doesn't quite work in docker the question is do we need nodemon and/or do we need docker? I would rather have both so my vore is -L :D
okay so the question I have is whether or not we want to put the frontend in there with it? Ideally front would be a separate server, but right now it's in there together with dashd and backend. Just something to think about, I don't mind working like this for a while.
Oh actually, could you also add a 1-2-3 on how to start your development environment? So if a new guy comes along s/he can just start the thing with no hassle.
Will send a new PR with an update to readme with how to run the dockerfile.
Regarding the frontend, another option to think about would be to host it as a static website that communicates with the API. This would allow us to separate it from the backend without needing to manage another server (and would be very cheap and scalable). The downside would be SEO since any dynamic pages would not be easily crawable by search engines.
Yeah I wanted to go the static route, but for privacy reasons the site must also work without JavaScript. So server side rendering is a must. That's why I chose next.js as the framework. It's super flexible, easy to work with and has server-side rendering built in.
Nice! I've been looking for an excuse to try next.js 👍
This PR adds a Dockerfile for local development. There are a couple things I could use your feedback on:
I'm currently starting dashd without any parameters here. I'm still familiarizing myself with the command but I think ideally we would start this with the same parameters as production.
The server does not wait for the dashd to download the wallet before serving the API. This results in 500 errors until the wallet is done downloading. Not sure how best to resolve this but if we plan to dockerize the production servers, add tests and use CI/CD we'll probably need to figure this out. Unfortunately I'm still pretty new to docker so not sure the best way to move forward with fixing it.
In order to make nodemon work with the docker container I had to put it in legacy watch mode. This seems to be the suggested workaround according to nodemon docs: https://github.com/remy/nodemon#application-isnt-restarting