Skip to content

Commit 150b1ea

Browse files
committed
feat: dockerfile for windows and project ideas
1 parent 4249e44 commit 150b1ea

File tree

3 files changed

+88
-48
lines changed

3 files changed

+88
-48
lines changed

Dockerfile

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,29 @@
11
# Stage 1: Build Frontend
2-
FROM mcr.microsoft.com/mirror/docker/library/node:18-alpine AS frontend-builder
2+
FROM node:18-alpine AS frontend-builder
33
WORKDIR /frontend
44
COPY chat-ui/ .
55
RUN npm install
66
RUN npm run build
77

88
# Stage 2: Build Backend
9-
FROM mcr.microsoft.com/mirror/docker/library/python:3.11-slim AS backend-builder
9+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS backend-builder
10+
ADD . /flare-ai-social
1011
WORKDIR /flare-ai-social
11-
12-
# Install build dependencies and uv globally
13-
RUN apt-get update && \
14-
apt-get install -y --no-install-recommends \
15-
build-essential \
16-
curl && \
17-
rm -rf /var/lib/apt/lists/* && \
18-
pip install uv
19-
20-
# Create and activate virtual environment
21-
RUN python -m venv .venv && \
22-
. .venv/bin/activate && \
23-
python -m pip install --upgrade pip
24-
25-
ENV PATH="/flare-ai-social/.venv/bin:$PATH"
26-
ENV VIRTUAL_ENV="/flare-ai-social/.venv"
27-
ENV PYTHONPATH="/flare-ai-social/.venv/lib/python3.11/site-packages"
28-
29-
# Copy project files
30-
COPY pyproject.toml ./
31-
COPY . .
32-
33-
# Install dependencies based on the file type
34-
RUN if [ -f "requirements.txt" ]; then \
35-
uv pip install -r requirements.txt; \
36-
elif [ -f "pyproject.toml" ]; then \
37-
uv sync --frozen; \
38-
fi
12+
RUN uv sync --frozen
3913

4014
# Stage 3: Final Image
41-
FROM mcr.microsoft.com/mirror/docker/library/python:3.11-slim
15+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
4216

43-
# Install runtime dependencies and uv
44-
RUN apt-get update && \
45-
apt-get install -y --no-install-recommends \
46-
nginx \
47-
supervisor \
48-
curl && \
49-
rm -rf /var/lib/apt/lists/* && \
50-
pip install uv
17+
# Install nginx
18+
RUN apt-get update && apt-get install -y nginx supervisor curl && \
19+
rm -rf /var/lib/apt/lists/*
5120

5221
WORKDIR /app
53-
54-
# Copy virtual environment and project files
5522
COPY --from=backend-builder /flare-ai-social/.venv ./.venv
5623
COPY --from=backend-builder /flare-ai-social/src ./src
5724
COPY --from=backend-builder /flare-ai-social/pyproject.toml .
5825
COPY --from=backend-builder /flare-ai-social/README.md .
5926

60-
# Set up Python environment in the final stage
61-
ENV PATH="/app/.venv/bin:$PATH"
62-
ENV VIRTUAL_ENV="/app/.venv"
63-
ENV PYTHONPATH="/app/.venv/lib/python3.11/site-packages"
64-
6527
# Copy frontend files
6628
COPY --from=frontend-builder /frontend/build /usr/share/nginx/html
6729

Dockerfile.windows

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Stage 1: Build Frontend
2+
FROM mcr.microsoft.com/mirror/docker/library/node:18-alpine AS frontend-builder
3+
WORKDIR /frontend
4+
COPY chat-ui/ .
5+
RUN npm install
6+
RUN npm run build
7+
8+
# Stage 2: Build Backend
9+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS backend-builder
10+
ADD . /flare-ai-social
11+
WORKDIR /flare-ai-social
12+
RUN uv sync --frozen
13+
14+
# Stage 3: Final Image
15+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
16+
17+
# Install nginx
18+
RUN apt-get update && apt-get install -y nginx supervisor curl && \
19+
rm -rf /var/lib/apt/lists/*
20+
21+
WORKDIR /app
22+
COPY --from=backend-builder /flare-ai-social/.venv ./.venv
23+
COPY --from=backend-builder /flare-ai-social/src ./src
24+
COPY --from=backend-builder /flare-ai-social/pyproject.toml .
25+
COPY --from=backend-builder /flare-ai-social/README.md .
26+
27+
# Copy frontend files
28+
COPY --from=frontend-builder /frontend/build /usr/share/nginx/html
29+
30+
# Copy nginx configuration
31+
COPY nginx.conf /etc/nginx/sites-enabled/default
32+
33+
# Setup supervisor configuration
34+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
35+
36+
# Allow workload operator to override environment variables
37+
LABEL "tee.launch_policy.allow_env_override"="GEMINI_API_KEY,TUNED_MODEL_NAME,SIMULATE_ATTESTATION"
38+
LABEL "tee.launch_policy.log_redirect"="always"
39+
40+
EXPOSE 80
41+
42+
# Start supervisor (which will start both nginx and the backend)
43+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,13 @@ The Docker setup mimics a TEE environment and includes an Nginx server for routi
8787
```bash
8888
docker build -t flare-ai-social .
8989
```
90+
**NOTE:** For Windows users encountering DNS issues, you can use the alternative Windows Dockerfile:
9091

91-
2. **Run the Docker Container:**
92+
```bash
93+
docker build -f Dockerfile.windows -t flare-ai-social .
94+
```
95+
96+
2. b**Run the Docker Container:**
9297

9398
```bash
9499
docker run -p 80:80 -it --env-file .env flare-ai-social
@@ -235,4 +240,34 @@ If you encounter issues, follow these steps:
235240

236241
## 💡 Next Steps
237242

238-
TODO
243+
Below are several detailed project ideas demonstrating how the template can be used to build autonomous AI agents:
244+
245+
### 1. Travel AI Agent
246+
- Implement a travel service layer that:
247+
- Connects to flight/hotel booking APIs
248+
- Manages itinerary generation
249+
- Handles payment processing
250+
- Stores user preferences/history
251+
- Agent interfaces with this to:
252+
- Process natural language travel requests
253+
- Check availability and pricing
254+
- Generate customized itineraries
255+
- Handle booking confirmations
256+
- Example: User asks "Book me a trip to Paris" -> Agent queries travel service for options -> Handles booking flow through conversation
257+
258+
### 2. Event & Updates Agent
259+
- **Core Concept**: Keep community informed about Flare developments
260+
- **Implementation**:
261+
- Monitor official channels for announcements
262+
- Summarize technical updates in accessible language
263+
- Answer questions about recent changes
264+
- Generate event reminders and summaries
265+
266+
### 3. DeFi Portfolio AI Agent
267+
268+
- Build a service that tracks single wallet DeFi positions, analyzes APY/risks, and calculates profit/loss
269+
- Process natural language queries through Twitter/Telegram for portfolio stats and alerts
270+
- Run sensitive wallet monitoring securely in TEE with attestation
271+
- Examples: "Check my wallet APY", "Alert me when health factor < 80%", "Show today's earnings"
272+
273+

0 commit comments

Comments
 (0)