BeforeIDieCode / BeforeIDieAchievements

🌟An open source project that helps developers make their first pull request and contribute to open source projects. πŸš€πŸŽ― Developers can contribute by sharing what they want to do before they die. πŸ’‘πŸ”—
https://before-i-die-achievements.vercel.app
MIT License
114 stars 178 forks source link

added YAML files for Docker #46 #137

Closed SimardeepSingh-zsh closed 11 months ago

SimardeepSingh-zsh commented 11 months ago

Issue Addressed

Proposed Changes and Benefits

Screenshots

Notes to Reviewers

Checklist

vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
before-i-die-achievements βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Sep 26, 2023 6:18pm
SimardeepSingh-zsh commented 11 months ago

git add Dockerfile git commit -m "Add Dockerfile for containerization" git push origin main

SimardeepSingh-zsh commented 11 months ago

docker build -t beforeidieachievements .

docker run -p 3000:3000 beforeidieachievements

XanderRubio commented 11 months ago

Excellent @SimardeepSingh-zsh!

I went ahead and tested it out on your branch and got it to work from running docker compose up! Do you know how to add the ability for the developer server to automatically open up for a user? This is new to me, and after doing a search I have found that potentailly on a macOS and windows system you would have to set-up a script and additional files. Curious if you know how to add the ability for the localhost: 3000 to automatically open up after running docker compose up?

Screenshot 2023-09-26 at 22 25 17
SimardeepSingh-zsh commented 11 months ago

!/bin/bash

Start Docker Compose

docker-compose up -d

Open the default web browser to localhost:3000

open http://localhost:3000

SimardeepSingh-zsh commented 11 months ago

Make this script executable (e.g., chmod +x start.sh) and then run it instead of directly running docker-compose up. It will start your containers and open a browser tab for you.

SimardeepSingh-zsh commented 11 months ago

Windows doesn't have a built-in command like open on macOS, but you can use PowerShell or other scripting languages to achieve a similar result.

Start Docker Compose

docker-compose up -d

Open the default web browser to localhost:3000

Start-Process -FilePath "http://localhost:3000"

SimardeepSingh-zsh commented 11 months ago

Save this script with a .ps1 extension (e.g., start.ps1) and run it instead of running docker-compose up.

XanderRubio commented 11 months ago

Wonderful! Everything makes sense. I was thinking, is it possible to automatically open the dev local server with just one command? However, this would depend on the user's operating system. As you mentioned, the user still needs to run chmod +x start.sh. Thank you for your valuable input. We will continue to improve this docker file as the project becomes more complex and add documentation to guide contributors on setting up the local dev server using docker. Simardeep, thank you for your assistance with the docker file and for sharing your expertise.

Thank you for your time! We will now go ahead with merging into the main branch. Please continue to contribute wherever you see fit. Additionally, I am planning to use the members feature on GitHub to organize Before I Die Code organization better and enable discussions. This will enhance our ability to collaborate with other contributors on the code. Have a great day and later on you will receive a request to become a member of the organization on GitHub once it is set-up πŸ‘πŸ»

XanderRubio commented 11 months ago

This closes issue #46