Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

gawandeabhishek
Copy link
Contributor

@gawandeabhishek gawandeabhishek commented Mar 29, 2024

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

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

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.

Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for creativecommons-chooser ready!

Name Link
🔨 Latest commit a06528c
🔍 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 gawandeabhishek changed the title Add Dockerfile and docker-compose.yml for containerization of the Cre… Add Dockerfile and docker-compose.yml for the containerization of the Chooser repository. Mar 29, 2024
@gawandeabhishek gawandeabhishek marked this pull request as ready for review April 1, 2024 19:26
@gawandeabhishek gawandeabhishek requested review from a team as code owners April 1, 2024 19:26
@gawandeabhishek gawandeabhishek requested review from TimidRobot, possumbilities and obulat and removed request for a team April 1, 2024 19:26
README.md Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
…ocumentation, downgraded Docker Compose version, and ensured docker-compose file ends with newline.
@gawandeabhishek gawandeabhishek force-pushed the feature/dockerize-chooser branch from 14b2bcd to 4bc5152 Compare April 2, 2024 12:20
Copy link
Member

@TimidRobot TimidRobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good! just a few changes to refine and make it work well if a person was previously using npm on their laptop (instead of in Docker)

docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@gawandeabhishek gawandeabhishek force-pushed the feature/dockerize-chooser branch from 0218255 to 480eb2a Compare April 5, 2024 18:53
Copy link
Member

@TimidRobot TimidRobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this will be really helpful, thank you!

@TimidRobot TimidRobot self-assigned this Apr 5, 2024
@TimidRobot TimidRobot merged commit 92d49c1 into creativecommons:main Apr 5, 2024
5 checks passed
@gawandeabhishek
Copy link
Contributor Author

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

@TimidRobot TimidRobot mentioned this pull request Apr 8, 2024
7 tasks
@TimidRobot TimidRobot linked an issue Apr 8, 2024 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Dockerization of Creative Commons Chooser Repository [Feature] Dockerize the App
2 participants