BabaK07 commited on
Commit
8c66fe6
·
1 Parent(s): 0d93816

Add Fly.io deployment configuration

Browse files
Files changed (3) hide show
  1. Dockerfile +15 -0
  2. README.md +23 -0
  3. fly.toml +22 -0
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1
5
+
6
+ WORKDIR /app
7
+
8
+ COPY pyproject.toml README.md ./
9
+ COPY app ./app
10
+
11
+ RUN pip install --no-cache-dir -e .
12
+
13
+ EXPOSE 8080
14
+
15
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
README.md CHANGED
@@ -158,3 +158,26 @@ This repo now includes a `render.yaml` Blueprint.
158
  Render uses:
159
  - Build command: `pip install -e .`
160
  - Start command: `uvicorn app.main:app --host 0.0.0.0 --port $PORT`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  Render uses:
159
  - Build command: `pip install -e .`
160
  - Start command: `uvicorn app.main:app --host 0.0.0.0 --port $PORT`
161
+
162
+ ## Deploy on Fly.io
163
+
164
+ This repo includes `Dockerfile` and `fly.toml`.
165
+
166
+ 1. Install Fly CLI:
167
+ - macOS: `brew install flyctl`
168
+ 2. Login:
169
+ - `fly auth login`
170
+ 3. If app name `docsbot-kbaba7` is unavailable, change `app` in `fly.toml`.
171
+ 4. Create app (first time only):
172
+ - `fly apps create docsbot-kbaba7`
173
+ 5. Set secrets:
174
+ - `fly secrets set SECRET_KEY=...`
175
+ - `fly secrets set DATABASE_URL=...`
176
+ - `fly secrets set GROQ_API_KEY=...`
177
+ - `fly secrets set SUPABASE_URL=...`
178
+ - `fly secrets set SUPABASE_SERVICE_ROLE_KEY=...`
179
+ - optional: `fly secrets set TAVILY_API_KEY=...`
180
+ 6. Deploy:
181
+ - `fly deploy`
182
+ 7. Open app:
183
+ - `fly open`
fly.toml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ app = "docsbot-kbaba7"
2
+ primary_region = "bom"
3
+
4
+ [build]
5
+ dockerfile = "Dockerfile"
6
+
7
+ [env]
8
+ STORAGE_BACKEND = "supabase"
9
+ WEB_SEARCH_PROVIDER = "tavily"
10
+
11
+ [http_service]
12
+ internal_port = 8080
13
+ force_https = true
14
+ auto_stop_machines = "stop"
15
+ auto_start_machines = true
16
+ min_machines_running = 0
17
+ processes = ["app"]
18
+
19
+ [[vm]]
20
+ cpu_kind = "shared"
21
+ cpus = 1
22
+ memory_mb = 1024