creativecommons / chooser

The new and improved CC license selection tool.
https://chooser-beta.creativecommons.org
MIT License
97 stars 124 forks source link

Add Dockerfile and docker-compose.yml for the containerization of the Chooser repository. #517

Closed gawandeabhishek closed 3 months ago

gawandeabhishek commented 3 months ago

Fixes

Description

My pull request dockerizes the Creative Commons Chooser repository. This helps developers avoid downgrading their Node.js version to 14 or below. If we do so, we encounter errors when installing packages via npm because if the version is 5 or something similar of npm, it will give an error. Therefore, to make it easier for contributors to contribute, it is advisable to start and run the application using Docker.

Technical details

I have added two files: Dockerfile and docker-compose.yml.

In Dockerfile, it creates an image and a separate Operating system for running the app. It allows us to use any version with any combination of versions of Node.js and npm, etc.

The docker-compose file composes commands and then runs them in sequence. If the code requires a certain command, for example, if we haven't installed any package, then 'npm install' will not run again. It will only run when we add or remove any package. If we add or delete any package in our project, then the 'npm install' command and the subsequent commands will rerun. Thus, we need to carefully write the sequence of commands, which I have done in this PR. Finally, by running the single command 'docker-compose up', our website will be live. However, the condition is that we should have Docker Desktop installed on our machine, which will create containers and images.

Tests

Install Docker from the official Docker website (Get Started | Docker) and then, after setting up Docker, run this command in the chooser folder: docker-compose up.

Checklist

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open-source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open-source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open-source license(s) involved.
netlify[bot] commented 3 months ago

Deploy Preview for creativecommons-chooser ready!

Name Link
Latest commit a06528c884fcbffacafdecdb6264fda3bad01e31
Latest deploy log https://app.netlify.com/sites/creativecommons-chooser/deploys/661050679f8ef20008ad7648
Deploy Preview https://deploy-preview-517--creativecommons-chooser.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

gawandeabhishek commented 3 months ago

I'm delighted to hear that! It was my pleasure to contribute.