EnCiv / undebate

Not debates, but recorded online video Q&A with candidates so voters can quickly can get to know them, for every candidate, for every election, across the US.
Other
20 stars 14 forks source link

Containerizing undebate environment #273

Closed shinjonathan closed 3 years ago

shinjonathan commented 3 years ago

This PR provides a convenient local setup that should minimize the steps & configuration required to boot up the application.

Three containers are provided by this compose environment.

ddfridley commented 3 years ago

Interesting. I have some questions:

  1. Mongo has files where it stores the data. Do they end up saved in the users files system, and if so where? (and lets make sure they don't get sucked in by git).
  2. In development we do npm run dev which uses nodemon and webpack so when we save a change to a file, the change is immediately updated in the server, and pushed to the browser. Is it possible to do this with docker? -- I assume docker is doing npm run start
  3. In production we are on mongo 3.6.12 and node ~10.16.2 can we set it to those at least until after the election. And then, we should only go to node 12 in production.
shinjonathan commented 3 years ago
  1. Mongo data will be stored in the docker container. It's easiest to think of these as virtual machines. The data in the container unless a volume is specified to mount to (in case you want to share data between containers or locally). Therefore the data will be blown away if the container is deleted. Only the image building steps and the environment orchestration steps will be committed to git.

  2. I've built the undebate docker image using npm start. I wouldn't recommend having hot reload enabled for docker containers. These containers should always be as close to production specs as possible. In most deployment strategies. That image is tagged and deployed to production as is. This build and deploy patter addresses "it works on my machine" kind of bugs.

  3. Most recent commit addresses changes version to mongo 3.6 and node 12