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
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,33 @@ After running the seed script, you can log in with these local-only development
| Student 1 | `student1@learnhub.com` | `student1password` |
| Student 2 | `student2@learnhub.com` | `student2password` |

> These accounts are for local development only and are generated by the seed script.
<br/>

## (Alternatively)Running with Docker

### Start all services

```bash
docker compose up --build
```

### Stop services

```bash
docker compose down
```

### Seed the database

```bash
docker compose exec backend node seed.js
```

Frontend: http://localhost:5173

Backend: http://localhost:5000

## 🛠 Roadmap / Not Yet Implemented

## Roadmap / Not Yet Implemented

Expand Down
5 changes: 5 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
.gitignore
npm-debug.log
Dockerfile
12 changes: 12 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:22-alpine

WORKDIR /app
COPY package*.json ./

RUN npm ci

COPY . .

EXPOSE 5000

CMD [ "npm", "start" ]
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
services:
mongodb:
image: mongo:8

ports:
- "27017:27017"

volumes:
- mongo-data:/data/db

backend:
build:
context: ./backend

container_name: learnhub-backend

ports:
- "5000:5000"

env_file:
- ./backend/.env

environment:
MONGO_URI: mongodb://mongodb:27017/learnhub

depends_on:
- mongodb

volumes:
- ./backend:/app
- /app/node_modules

frontend:
build:
context: ./frontend

container_name: learnhub-frontend

ports:
- "5173:5173"

depends_on:
- backend

volumes:
- ./frontend:/app
- /app/node_modules

volumes:
mongo-data:
6 changes: 6 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.git
.gitignore
npm-debug.log
Dockerfile
13 changes: 13 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22-alpine

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . .

EXPOSE 5173

CMD [ "npm", "run", "dev", "--", "--host" ]
Loading