Daniel McKnight commited on
Commit
9e6d175
·
unverified ·
1 Parent(s): 7c4c945

Implement Docker deployment (#1)

Browse files

* Implement Dockerfile with documentation for image building/running

* Integrate upstream documentation changes

* Implement `docker-compose.yml` with updated documentation

* Bind to all interfaces to enable Docker deployment

* Pin `bcrypt` dependency to resolve registration errors

* Add envvar handling for CORS/API_URL settings

* Add Docker volume for MongoDB persistence

* Update README to include Docker config example/instructions

Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:24-bookworm AS base
2
+
3
+ LABEL vendor=neon.ai \
4
+ ai.neon.name="CCAI-Demo"
5
+
6
+ ENV OVOS_CONFIG_BASE_FOLDER=neon
7
+ ENV OVOS_CONFIG_FILENAME=neon.yaml
8
+ ENV XDG_CONFIG_HOME=/config
9
+
10
+ RUN apt-get update && \
11
+ apt-get install -y \
12
+ python3 \
13
+ python3-pip
14
+
15
+ COPY . /ccai
16
+ WORKDIR /ccai/multi_llm_chatbot_backend
17
+
18
+ RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
19
+
20
+ FROM base AS backend
21
+
22
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
23
+
24
+ FROM base AS frontend
25
+ WORKDIR /ccai/phd-advisor-frontend
26
+
27
+ RUN npm install
28
+
29
+ CMD [ "npm", "start" ]
README.md CHANGED
@@ -29,10 +29,37 @@ An AI-powered academic guidance system that provides personalized advice through
29
  - **Document Processing**: PDF, DOCX, and text file extraction with intelligent chunking
30
  - **Authentication**: JWT tokens with bcrypt password hashing
31
 
32
- ## Prerequisites
 
 
33
 
34
- Before you begin, ensure you have the following installed:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
 
36
  - **Python 3.8+** (3.9+ recommended)
37
  - **Node.js 16+** and npm
38
  - **MongoDB** (Community Edition)
@@ -444,4 +471,4 @@ phd-advisor-panel/
444
 
445
  © 2025 University of Colorado Boulder. All rights reserved.
446
 
447
- This project is developed and maintained by the University of Colorado Boulder for academic and research purposes.
 
29
  - **Document Processing**: PDF, DOCX, and text file extraction with intelligent chunking
30
  - **Authentication**: JWT tokens with bcrypt password hashing
31
 
32
+ ## Quick Start (Docker)
33
+ ### Prerequisites
34
+ - **Docker**
35
 
36
+ ### Instructions
37
+ 1. **Clone the repository**
38
+ ```bash
39
+ git clone https://github.com/sohank-17/Neon-AI-Project
40
+ cd Neon-AI-Project
41
+ ```
42
+
43
+ 1. **Configure via `.env` file**
44
+ Create a `.env` file in the root of the project with:
45
+ ```
46
+ GEMINI_API_KEY=<valid Gemini API key>
47
+ JWT_SECRET_KEY=<Generated UUID>
48
+ REACT_APP_API_URL=http://localhost:8000
49
+ CORS_ORIGINS=http://localhost:3000
50
+ ```
51
+ > `REACT_APP_API_URL` and `CORS_ORIGINS` must match the real addresses used if accessing the demo from a remote host.
52
+
53
+ 2. **Build and Run Containers**
54
+ ```bash
55
+ docker compose up -d
56
+ ```
57
+
58
+ 3. **Access the application**
59
+ - Frontend: `http://localhost:3000`
60
+ - Backend API: `http://localhost:8000`
61
 
62
+ ## Local Installation Prerequisites
63
  - **Python 3.8+** (3.9+ recommended)
64
  - **Node.js 16+** and npm
65
  - **MongoDB** (Community Edition)
 
471
 
472
  © 2025 University of Colorado Boulder. All rights reserved.
473
 
474
+ This project is developed and maintained by the University of Colorado Boulder for academic and research purposes.
docker-compose.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ backend:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ target: backend
7
+ ports:
8
+ - "8000:8000"
9
+ networks:
10
+ - application
11
+ depends_on:
12
+ - database
13
+ environment:
14
+ MONGODB_CONNECTION_STRING: "mongodb://database:27017"
15
+ MONGODB_DATABASE: phd_advisor
16
+ JWT_SECRET_KEY: ${JWT_SECRET_KEY:-"CHANGEME-by-overriding-in-dot-env-file"}
17
+ GEMINI_API_KEY: ${GEMINI_API_KEY:-?}
18
+ CORS_ORIGINS: ${CORS_ORIGINS:-"http://localhost:3000"}
19
+ GEMINI_MODEL: gemini-2.5-flash
20
+ frontend:
21
+ build:
22
+ context: .
23
+ dockerfile: Dockerfile
24
+ target: frontend
25
+ ports:
26
+ - "3000:3000"
27
+ networks:
28
+ - application
29
+ depends_on:
30
+ - backend
31
+ environment:
32
+ REACT_APP_API_URL: ${REACT_APP_API_URL:-"http://localhohst:8000"}
33
+ database:
34
+ image: mongo:8.0
35
+ volumes:
36
+ - mongo_data:/data/db
37
+ networks:
38
+ - application
39
+ volumes:
40
+ mongo_data:
41
+ networks:
42
+ application:
43
+ driver: bridge
44
+ driver_opts:
45
+ com.docker.network.bridge.host_binding_ipv4: "0.0.0.0"
multi_llm_chatbot_backend/requirements.txt CHANGED
@@ -31,7 +31,11 @@ motor
31
 
32
  # Authentication and security
33
  passlib[bcrypt]
 
 
34
  python-jose[cryptography]
35
 
36
  # Data validation (required for EmailStr in Pydantic)
37
- email-validator
 
 
 
31
 
32
  # Authentication and security
33
  passlib[bcrypt]
34
+ # `bcrypt` pinned for compat.
35
+ bcrypt~=4.0
36
  python-jose[cryptography]
37
 
38
  # Data validation (required for EmailStr in Pydantic)
39
+ email-validator
40
+ python-docx
41
+ python-multipart