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

Dockerize Container #88

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Conversation

MAVRICK-1
Copy link
Contributor

Summary of Changes

This PR introduces a multi-stage Dockerfile and a corresponding nginx.conf for the Mujtabaa07-coffeeShop project. The changes optimize the build process and provide a production-ready containerized setup.

Related Issue

Fixes #69 (issue tracking containerization and deployment setup).


Relevant Motivation and Context

The changes are motivated by the need for an efficient and secure deployment pipeline. The multi-stage Dockerfile:

  • Reduces the image size by separating the build and runtime stages.
  • Ensures production readiness by serving the app via Nginx.
  • Improves maintainability with a clear distinction between development and production stages.

The nginx.conf enables single-page application (SPA) support by redirecting 404s to index.html.

Dependencies

  • Docker
  • Nginx (in production stage)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor Code
  • A documentation update
  • Others (mention in the issue number)

How Has This Been Tested?

Test A: Build and Run Locally

  1. Build the Docker image using docker build -t mujtabaa07-coffeeshop ..
  2. Run the container with docker run -d -p 80:80 mujtabaa07-coffeeshop.
  3. Access the app on http://localhost.

Test B: SPA Behavior

  1. Navigate to a non-root route (e.g., /about).
  2. Verify the route renders correctly without 404 errors.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation (added notes about deployment).
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Copy link

vercel bot commented Jan 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
coffee-shop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 5:52pm

@MAVRICK-1
Copy link
Contributor Author

@Mujtabaa07 review my PR and add lables

@Mujtabaa07 Mujtabaa07 added SWOC Social Winter Of Code ADVANCE labels Jan 2, 2025
@Mujtabaa07 Mujtabaa07 merged commit c55b90a into Mujtabaa07:main Jan 2, 2025
2 of 3 checks passed
@Mujtabaa07
Copy link
Owner

🎉 Congratulations on Your Merged PR!

Thank you @MAVRICK-1 for your contribution!

What's Next?

Keep up the fantastic work! 🚀

@Mujtabaa07 Mujtabaa07 mentioned this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADVANCE SWOC Social Winter Of Code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerise this project
2 participants