File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- .PHONY : help build up down logs shell exec pull-model test clean fireform
1+ .PHONY : help build up down logs shell exec pull-model test clean fireform logs-app logs-ollama logs-frontend super-clean
22
33help :
44 @printf ' %s\n' \
1616 @echo " make up - Start all containers"
1717 @echo " make down - Stop all containers"
1818 @echo " make logs - View container logs"
19+ @echo " make logs-app - View API container logs"
20+ @echo " make logs-frontend - View frontend container logs"
21+ @echo " make logs-ollama - View Ollama container logs"
1922 @echo " make shell - Open Python shell in app container"
2023 @echo " make exec - Execute Python script in container"
2124 @echo " make pull-model - Pull Mistral model into Ollama"
@@ -45,6 +48,9 @@ logs-app:
4548logs-ollama :
4649 docker compose logs -f ollama
4750
51+ logs-frontend :
52+ docker compose logs -f frontend
53+
4854shell :
4955 docker compose exec app /bin/bash
5056
Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ echo "============================================"
1616make up
1717echo " ============================================"
1818echo " Use make down to stop"
19- echo " Use docker ps to verify, you should see 2 containers:"
19+ echo " Use docker ps to verify, you should see 3 containers:"
2020echo " \t* fireform-app"
21+ echo " \t* fireform-frontend"
2122echo " \t* ollama/ollama:latest"
2223docker ps
2324echo " ============================================"
@@ -26,4 +27,3 @@ echo "============================================"
2627make pull-model
2728echo " ============================================"
2829echo " Done"
29-
Original file line number Diff line number Diff line change @@ -23,16 +23,32 @@ services:
2323 depends_on :
2424 ollama :
2525 condition : service_healthy
26+ command : /bin/sh -c "python3 -m api.db.init_db && python3 -m uvicorn api.main:app --host 0.0.0.0 --port 8000"
2627 volumes :
2728 - .:/app
29+ ports :
30+ - " 8000:8000"
2831 environment :
2932 - PYTHONUNBUFFERED=1
3033 - PYTHONPATH=/app/src
3134 - OLLAMA_HOST=http://ollama:11434
3235 networks :
3336 - fireform-network
34- stdin_open : true
35- tty : true
37+
38+ frontend :
39+ image : python:3.11-slim
40+ container_name : fireform-frontend
41+ working_dir : /app
42+ command : python3 -m http.server 5173 --directory frontend
43+ volumes :
44+ - .:/app
45+ ports :
46+ - " 5173:5173"
47+ depends_on :
48+ app :
49+ condition : service_started
50+ networks :
51+ - fireform-network
3652
3753volumes :
3854 ollama_data :
Original file line number Diff line number Diff line change 11# Docker documentation for FireForm
22
33## Setup
4- We will be using 2 different containers:
5- 1 . ` fireform-app ` -> This container will hold the whole project itself.
6- 2 . ` ollama/ollama:latest ` -> This is to deploy ollama, that way it's faster to set up.
4+ We will be using 3 containers:
5+ 1 . ` fireform-app ` -> Runs the FastAPI server on ` http://127.0.0.1:8000 ` .
6+ 2 . ` fireform-frontend ` -> Serves the frontend on ` http://127.0.0.1:5173 ` .
7+ 3 . ` ollama/ollama:latest ` -> Runs Ollama for LLM calls.
78
89### Initial configuration steps
910For this I provided a script that can be run to automate the setup.
@@ -46,6 +47,23 @@ make clean # Remove all containers and volumes
4647```
4748* You can see this list at any time by running ` make help ` .
4849
50+ ## Running the full stack
51+
52+ ``` bash
53+ make build
54+ make up
55+ ```
56+
57+ Then open:
58+ - Frontend: ` http://127.0.0.1:5173 `
59+ - API docs: ` http://127.0.0.1:8000/docs `
60+
61+ If this is your first run, pull the model once:
62+
63+ ``` bash
64+ make pull-model
65+ ```
66+
4967## Debugging
5068For debugging with LLMs it's really useful to attach the logs.
5169* You can obtain the logs using ` make logs ` or ` docker compose logs ` .
You can’t perform that action at this time.
0 commit comments