code4sac / openbudgetsac.org

Code for Sacramento's Open Budget Project (landing page + D3.js files)
http://openbudgetsac.org
MIT License
17 stars 25 forks source link

Add support for docker compose #57

Closed natebass closed 1 year ago

natebass commented 1 year ago

The application can now be run with docker compose up. This resolves the issue of requiring Node 16 to be installed when developing locally.

The build command is now run with npx, which requires a new dependency of webpack-cli and modifications to the webpack and babel configuration files. Just to be safe, I copied all other dependencies to match Open Budget Oakland's package.json. Using npx to run webpack fixes the following error when building on Windows without docker.

'node_modules' is not recognized as an internal or external command, operable program or batch file.

Please let me know if the docker files look correct. I am wondering about the end of the Dockerfile if I should include an ENTRYPOINT like ENTRYPOINT ["npx"]. It runs OK on my system using only CMD ["npx", "@11ty/eleventy", "--serve", "--port=8011"].

feydan commented 1 year ago

Can you also update the README to include the docker version of installing and running. Make sure to mention to run docker-compose up --build and that cycling is needed in between code changes.

feydan commented 1 year ago

I think it would be good after merging this to create an issue to improve the developer experience by supporting the watch commands so that the application hot reloads after code changes. This would make it easier to develop so that you do not need to reload docker after every code change.