feat: Add Docker support for MERN template#107
feat: Add Docker support for MERN template#107amanvatss wants to merge 1 commit intoceltrix-os:mainfrom
Conversation
|
i think we need a little improvement here you mention both server and client in same image i think best practice should be creating image for server and client separate is better |
|
Hi @Abdulk077, thanks for the feedback! You are absolutely right that separate images for the server and client is the best practice. That is the approach I have taken in this pull request. If you look at the files, you'll see:
I believe this follows the best practice you mentioned. Please let me know if you see anything I could improve in the implementation. Thanks! |
|
one thing you should add the a non-root user for better security for an frontend app , one thing in production uses separate compose file for scaling purpose that's what all I said . |
|
Give me an opportunity for dockerise |
Hi @JoeCelaster, this PR adds full Docker support for the MERN template, allowing developers to get the entire application running with a single command.
Before This PR
To run the project, a developer had to:
After This PR (Proof of Work)
With these changes, a developer only needs to have Docker installed and run one command:
docker-compose up.This automatically builds, installs, and runs the frontend, backend, and database in a containerized environment.
Here is a screenshot of the final result, showing the application running successfully in the browser:
Files Added
templates/mern/javascript/server/Dockerfile: A recipe to containerize the backend server.templates/mern/javascript/client/Dockerfile: A recipe to containerize the frontend client.templates/mern/javascript/docker-compose.yml: An orchestration file to manage and connect the client, server, and database containers.templates/mern/javascript/client/package.json: Updated thedevscript tovite --hostto allow external connections.This feature significantly improves the developer experience and aligns with the project's goal of faster setups.
Closes #103