creativecommons / legaldb

CC Legal Database: curated repository of Case Law and Scholarship data from around the world in a Django based website.
https://LegalDB.CreativeCommons.org/
MIT License
45 stars 67 forks source link

Adding Docker and Docker Compose Support #94

Closed pratikdaigavane closed 3 years ago

pratikdaigavane commented 3 years ago

Problem

Currently, to set up the development environment, having python 3.7 and starting a separate Postgres server is required.

Description

This process can be automated by creating a docker image for Django server based on python 3.7 and using Postgres docker image. Then these images can be managed by docker-compose, hence requiring only a docker-compose up to start the server.

Further for Django server, a pipeline to run linter and to build the docker image can also be created using GitHub actions

Implementation

krysal commented 3 years ago

I was thinking the same, adding a docker-compose file could speed up development for newcomers and is good way to have the environment configurations documented. @pratikdaigavane If you want to take the lead here, I'll gladly review the pull request. Any suggestions for improvement are welcome!

pratikdaigavane commented 3 years ago

@krysal sure, I will take this issue!

pratikdaigavane commented 3 years ago

@krysal is it okay if I move all Django and Pipenv files inside a subfolder? this will reduce the build context and hence the size of the docker image will be less.

darkshredder commented 3 years ago

@krysal Should I create a new PR for adding Docker Support with new webpack setup?

TimidRobot commented 3 years ago

@krysal is it okay if I move all Django and Pipenv files inside a subfolder? this will reduce the build context and hence the size of the docker image will be less.

@pratikdaigavane No, the contents of repo are less than a mebibyte. Moving the files do to size is not worth it. if there an an organization that works well for Heroku (primary deployment target) and also improves developer experience, please do propose it.