Skip to content

Commit e957d69

Browse files
committed
feat(docker): Add Docker configuration files and update .gitignore
- Introduced .dockerignore to exclude temporary folders and unnecessary files from Docker context. - Added Dockerfile for containerization of the application with Nginx for serving static files. - Created DOCKER_README.md for Docker usage instructions. - Updated .gitignore to include agentx directory. - Added nginx.conf for Nginx configuration. - Introduced tsconfig.rslib.json and vitest.config.ts for TypeScript and testing configurations. - Removed deprecated agentx files to clean up the project structure.
1 parent 912a1bc commit e957d69

File tree

165 files changed

+8080
-14258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+8080
-14258
lines changed

web/.dockerignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Dependencies
2+
node_modules
3+
.pnpm-store
4+
.pnpm
5+
6+
# Build outputs
7+
dist
8+
build
9+
10+
# Development files
11+
.env.local
12+
.env.development.local
13+
.env.test.local
14+
.env.production.local
15+
16+
# IDE files
17+
.vscode
18+
.idea
19+
*.swp
20+
*.swo
21+
22+
# OS files
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Git
27+
.git
28+
.gitignore
29+
30+
# Docker
31+
Dockerfile
32+
docker-compose.yaml
33+
.dockerignore
34+
35+
# Testing
36+
coverage
37+
.nyc_output
38+
39+
# Logs
40+
npm-debug.log*
41+
yarn-debug.log*
42+
yarn-error.log*
43+
pnpm-debug.log*
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Microbundle cache
58+
.rpt2_cache/
59+
.rts2_cache_cjs/
60+
.rts2_cache_es/
61+
.rts2_cache_umd/
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# parcel-bundler cache (https://parceljs.org/)
73+
.cache
74+
.parcel-cache
75+
76+
# Next.js build output
77+
.next
78+
79+
# Nuxt.js build / generate output
80+
.nuxt
81+
82+
# Storybook build outputs
83+
.out
84+
.storybook-out
85+
86+
# Temporary folders
87+
tmp/
88+
temp/

web/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ dist
1313
.vscode/*
1414
!.vscode/extensions.json
1515
.idea
16+
17+
agentx

web/DOCKER_README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Web Frontend Docker Deployment Guide
2+
3+
This directory contains Docker configuration files for deploying the React frontend application.
4+
5+
## File Description
6+
7+
- `Dockerfile` - Multi-stage Docker file for production build
8+
- `nginx.conf` - Nginx configuration file for production environment
9+
- `docker-compose.yaml` - Docker Compose configuration file
10+
- `.dockerignore` - Files to ignore during Docker build
11+
12+
## Usage
13+
14+
### Production Environment
15+
16+
#### Using Docker Compose
17+
18+
```bash
19+
# Build and start production environment
20+
docker-compose up --build
21+
22+
# Run in background
23+
docker-compose up -d --build
24+
```
25+
26+
Production environment will run on `http://localhost:80`.
27+
28+
#### Using Docker Commands
29+
30+
```bash
31+
# Build production image
32+
docker build -t langcrew-web .
33+
34+
# Run production container
35+
docker run -p 80:80 langcrew-web
36+
```
37+
38+
### Custom Configuration
39+
40+
#### Environment Variables
41+
42+
- `NODE_ENV` - Runtime environment (production)
43+
- `AGENT_API_HOST` - Backend API address
44+
45+
#### Port Configuration
46+
47+
- Production environment: 80
48+
49+
## Build Stages
50+
51+
1. **build** - Build stage, installs dependencies and builds the application
52+
2. **production** - Production stage, serves static files using Nginx
53+
54+
## Features
55+
56+
- **Multi-stage build** - Optimized image size and build efficiency
57+
- **Production optimized** - Nginx serving, compression, caching
58+
- **Security** - Security headers and optimized configuration
59+
- **Performance** - Static asset optimization and gzip compression
60+
61+
## Notes
62+
63+
- Make sure Docker and Docker Compose are installed before running
64+
- Production environment uses Nginx to serve static files
65+
- All static assets are compressed and cache-optimized
66+
- The application supports client-side routing

web/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Production build for React frontend application
2+
FROM node:18-alpine AS build
3+
4+
# Install pnpm globally
5+
RUN npm install -g pnpm
6+
7+
# Set working directory
8+
WORKDIR /app
9+
10+
# Copy package files
11+
COPY package.json pnpm-lock.yaml ./
12+
13+
# Install dependencies
14+
RUN pnpm install --frozen-lockfile
15+
16+
# Copy source code
17+
COPY . .
18+
19+
# Build the application
20+
ENV NODE_ENV=production
21+
RUN pnpm build
22+
23+
# Production stage
24+
FROM nginx:alpine
25+
26+
# Copy built assets from build stage
27+
COPY --from=build /app/dist /usr/share/nginx/html
28+
29+
# Copy nginx configuration
30+
COPY nginx.conf /etc/nginx/conf.d/default.conf
31+
32+
# Expose port
33+
EXPOSE 80
34+
35+
# Start nginx
36+
CMD ["nginx", "-g", "daemon off;"]

web/README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pnpm install
5252
pnpm dev
5353

5454
# Open Browser
55-
http://localhost:3000/chat
55+
http://localhost:3600/chat
5656
```
5757

5858
---
@@ -79,12 +79,8 @@ pnpm add ./agentx
7979
import AgentX from 'agentx';
8080

8181
<AgentX
82-
agentId="your-agent-id"
83-
sessionId=""
8482
shareId=""
8583
sharePassword=""
86-
basePath=""
87-
backPath=""
8884
headerNode={<></>}
8985
footerNode={<></>}
9086
shareButtonNode={<></>}
@@ -100,20 +96,14 @@ import AgentX from 'agentx';
10096
/>;
10197
```
10298

103-
> **Note:**`agentId` is **required** and must be obtained from the **LangCrew Admin Panel**.
104-
10599
---
106100

107101
## 📚 API Reference
108102

109103
| Prop Name | Type | Description | Required |
110104
| ---------------------- | ------------- | ---------------------------- | -------- |
111-
| agentId | `string` | Agent ID ||
112-
| sessionId | `string` | Session ID ||
113105
| shareId | `string` | Share ID ||
114106
| sharePassword | `string` | Share password ||
115-
| basePath | `string`(URL) | Route prefix ||
116-
| backPath | `string`(URL) | Return path ||
117107
| headerNode | `ReactNode` | Custom header ||
118108
| footerNode | `ReactNode` | Custom footer ||
119109
| shareButtonNode | `ReactNode` | Custom share button ||

web/agentx/327.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

web/agentx/hashWorker.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)