diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..dd0ab5c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ + +FROM node:18 AS frontend-build + +WORKDIR /app/frontend +COPY frontend/package*.json ./ + +RUN npm install + +COPY frontend/ ./ + +FROM node:18 AS backend-build + +WORKDIR /app/backend +COPY backend/package*.json ./ + +RUN npm install + +COPY backend/ ./ + +FROM node:18 + +WORKDIR /app + +COPY --from=backend-build /app/backend ./backend +COPY --from=frontend-build /app/frontend ./frontend + +COPY frontend/package*.json ./frontend/ +COPY backend/package*.json ./backend/ +RUN npm install --prefix frontend && npm install --prefix backend + + +COPY start.sh ./ + +RUN chmod +x start.sh + +EXPOSE 5173 3000 + + +CMD ["sh", "start.sh"] diff --git a/README.md b/README.md index 3754393d..f81fd975 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,22 @@ Make sure you follow our contributing guidlines:- [here](https://github.com/Ram npm run dev 4. Open your browser at `http://localhost:3000` to see the project running! 🌟 +Set-up using Dockerfile:- +1. **Build Docker Image**: + ```bash + docker build -t playcafe . +2. **Run Docker Image** + ```bash + docker run -p 5173:5173 -p 3000:3000 playcafe +3. Open your browser at `http://localhost:5173` to see the project running! 🌟 + +Set-up using docker-compose :- + +1. **Build Docker Image and Run the Application**: + ```bash + docker compose up --build + ## 🤝 Contributing We love contributions! 💙 Whether you're a participant in **GSSoC** or an open-source enthusiast, we welcome your input. Here's how you can contribute: @@ -118,6 +133,13 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Tejas Benibagde +