Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
FROM node:18-alpine AS builder
FROM node:20-alpine

# Set working directory inside the container
WORKDIR /app

COPY package*.json ./

# Install dependencies with legacy peer deps fix
RUN npm install --legacy-peer-deps

COPY . .
RUN npm run build

# Production Image
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app /app
# No need to run 'npm run build' for development-mode Docker
EXPOSE 3000

CMD ["npm", "run","serve"]
CMD [ "npm", "run", "dev" ]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ docker run -p 3000:3000 recodehive-app

This command will start a development server and open the application in your default web browser.

## ⚡ Local Development with Docker Compose & Hot Reload

For an even smoother experience, contributors can leverage **Docker Compose with hot reloading**.
This lets you see code changes instantly at [http://localhost:3000](http://localhost:3000) without rebuilding or restarting containers.

### 🏃 Quick Start

```bash
git clone https://github.com/your-username/recodehive-website.git
cd recodehive-website
docker-compose up
```

### 🚢 Production Deployment
```bash
npm run build
npm run serve
```

**If you'd like to contribute to CodeHarborHub, please follow these guidelines:**

- **Fork** the repository and clone it locally.
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: "3.9"

services:
recodehive:
build:
Expand All @@ -8,8 +7,8 @@ services:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
- /app/node_modules # Prevents node_modules being overwritten by the mount
working_dir: /app
command: npm run start
command: npm run dev # THIS is the crucial change for hot-reload!
environment:
- NODE_ENV=development
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"dev": "docusaurus start",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
Expand All @@ -15,14 +16,14 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.8.1",
"@docusaurus/plugin-content-docs": "3.8.1",
"@docusaurus/plugin-google-analytics": "^3.8.1",
"@docusaurus/plugin-ideal-image": "3.8.1",
"@docusaurus/preset-classic": "^3.8.1",
"@docusaurus/theme-classic": "^3.8.1",
"@docusaurus/theme-mermaid": "3.8.1",
"@docusaurus/theme-search-algolia": "3.8.1",
"@docusaurus/core": "^3.9.1",
"@docusaurus/plugin-content-docs": "3.9.1",
"@docusaurus/plugin-google-analytics": "^3.9.1",
"@docusaurus/plugin-ideal-image": "3.9.1",
"@docusaurus/preset-classic": "^3.9.1",
"@docusaurus/theme-classic": "^3.9.1",
"@docusaurus/theme-mermaid": "3.9.1",
"@docusaurus/theme-search-algolia": "3.9.1",
"@floating-ui/react": "^0.27.8",
"@giscus/react": "^3.1.0",
"@mdx-js/react": "^3.0.0",
Expand Down
Loading