Skip to content

Optimize Docker images and add .dockerignore for frontend and backend - #22

Open
amanydv860 wants to merge 14 commits into
iam-veeramalla:composefrom
amanydv860:feature
Open

Optimize Docker images and add .dockerignore for frontend and backend#22
amanydv860 wants to merge 14 commits into
iam-veeramalla:composefrom
amanydv860:feature

Conversation

@amanydv860

Copy link
Copy Markdown

Summary

This PR optimizes the Docker setup for both frontend and backend:

  • Reduced Docker image sizes using multi-stage builds
  • Added .dockerignore files to exclude unnecessary files (node_modules, .git, logs, etc.)
  • Switched to Alpine base images for smaller footprints
  • Updated docker-compose.yml to use registry images for faster deployment

Benefits

  • Faster build times
  • Smaller image sizes (frontend: ~178MB, backend: ~60-70MB)
  • Cleaner production images without dev dependencies
  • Easier to pull and run from Docker registry

Notes

  • Frontend now runs on port 3000 inside container; mapped to 5173 locally in compose
  • Backend connects to MongoDB using service name in compose network
  • Environment variables are configurable via compose

This PR does not change application functionality, only Docker setup and deployment efficiency.

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.

2 participants