File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 1- FROM node:18 -alpine AS builder
1+ FROM node:20 -alpine
22
3- # Set working directory inside the container
43WORKDIR /app
54
65COPY package*.json ./
76
8- # Install dependencies with legacy peer deps fix
97RUN npm install --legacy-peer-deps
108
119COPY . .
12- RUN npm run build
1310
14- # Production Image
15- FROM node:18-alpine
16- WORKDIR /app
17- COPY --from=builder /app /app
11+ # No need to run 'npm run build' for development-mode Docker
1812EXPOSE 3000
1913
20- CMD ["npm" , "run" ,"serve" ]
14+ CMD [ "npm" , "run" , "dev" ]
Original file line number Diff line number Diff line change @@ -80,6 +80,25 @@ docker run -p 3000:3000 recodehive-app
8080
8181 This command will start a development server and open the application in your default web browser.
8282
83+ ## ⚡ Local Development with Docker Compose & Hot Reload
84+
85+ For an even smoother experience, contributors can leverage ** Docker Compose with hot reloading** .
86+ This lets you see code changes instantly at [ http://localhost:3000 ] ( http://localhost:3000 ) without rebuilding or restarting containers.
87+
88+ ### 🏃 Quick Start
89+
90+ ``` bash
91+ git clone https://github.com/your-username/recodehive-website.git
92+ cd recodehive-website
93+ docker-compose up
94+ ```
95+
96+ ### 🚢 Production Deployment
97+ ``` bash
98+ npm run build
99+ npm run serve
100+ ```
101+
83102** If you'd like to contribute to CodeHarborHub, please follow these guidelines:**
84103
85104- ** Fork** the repository and clone it locally.
Original file line number Diff line number Diff line change 11version : " 3.9"
2-
32services :
43 recodehive :
54 build :
@@ -8,8 +7,8 @@ services:
87 - " 3000:3000"
98 volumes :
109 - .:/app
11- - /app/node_modules
10+ - /app/node_modules # Prevents node_modules being overwritten by the mount
1211 working_dir : /app
13- command : npm run start
12+ command : npm run dev # THIS is the crucial change for hot-reload!
1413 environment :
1514 - NODE_ENV=development
Original file line number Diff line number Diff line change 44 "private" : true ,
55 "scripts" : {
66 "docusaurus" : " docusaurus" ,
7+ "dev" : " docusaurus start" ,
78 "start" : " docusaurus start" ,
89 "build" : " docusaurus build" ,
910 "swizzle" : " docusaurus swizzle" ,
You can’t perform that action at this time.
0 commit comments