developmentseed / skynet-data

[DEPRECATED] Data pipeline for machine learning with OpenStreetMap
ISC License
169 stars 32 forks source link

Made it easier to run local docker container with docker-compose #18

Closed dbdean closed 6 years ago

dbdean commented 6 years ago

I was finding some inefficiencies in having to build and run my own local docker instead of using the prebuilt ones, so I set up a single container docker-compose to help out. This PR has the following main changes:

  1. docker container now runs as non-priviledged user instead of root (no more root-owned files in your data directory)
  2. environment files can be saved in a (gitignored) docker.env file to avoid having to pass many configuration parameters on the command line
  3. local docker builds are as easy as docker-compose build, docker-compose run data download-osm-tiles, docker-compose run data.
  4. because docker-compose mounts the code into the container as a volume, you can make changes without having to rebuild (unless you need to refresh the node_modules - then you need to rebuild).

I have also updated the README to reflect these changes.

I would appreciate any comments you have and are happy to help improve this PR in any way to help get it in.

drewbo commented 6 years ago

Don't have a ton of time for a full review but on quick scan this looks good. I'll test it out and merge in sometime in the next week. I also love the idea of the .env file since it could stand is as "configuration" for multiple dataset preparations. Thanks

drewbo commented 6 years ago

Man my "next week" comment looks pretty bad above. Checking this out today and will update. Thanks again @dbdean

drewbo commented 6 years ago

Looks to good to merge:

dbdean commented 6 years ago

@drewbo, the not having root-owned folders in data means that you don't have to use sudo to access or modify the data when you are not inside of docker, and it also (more importantly) is a side-effect of no longer running the docker container as a privileged user when it is not required to be so, which is generally a good security principle.

dbdean commented 6 years ago

Thanks @drewbo!