Skip to content

Commit e309501

Browse files
authored
ask-the-documents: Deploy to Fly (#3251)
1 parent 87838dd commit e309501

File tree

10 files changed

+85
-65
lines changed

10 files changed

+85
-65
lines changed

.github/workflows/release-examples-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- examples/waspello
3838
- examples/waspleau
3939
- examples/websockets-realtime-voting
40+
- examples/ask-the-documents
4041

4142
name: Deploy ${{ matrix.app-dir }}
4243

examples/ask-the-documents/README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![Ask The Documents Cover](./github.png)
44

5+
Live at https://ask-the-documents-client.fly.dev/
6+
57
## What does it do?
68

79
This is an example Wasp app that supports:
@@ -14,36 +16,34 @@ This is an example Wasp app that supports:
1416

1517
## Running it locally
1618

17-
First, makes sure you have Wasp installed.
18-
19-
```bash
20-
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
21-
```
19+
1. Make sure you have the latest version of Wasp installed.
2220

23-
Then, close this repo, position yourself in `custom-db` and start the database with:
21+
```bash
22+
curl -sSL https://get.wasp.sh/installer.sh | sh
23+
```
2424

25-
```bash
26-
cd custom-db
27-
./run_db.sh
28-
```
25+
2. Start the database with:
2926

30-
Follow the instructions in the script.
27+
```bash
28+
wasp start db --db-image pgvector/pgvector:pg17
29+
```
3130

32-
Fill the env variables in `.env.server`:
31+
3. Copy `.env.server.example` to `.env.server` and fill out the environment variables.
3332

34-
```
35-
OPENAI_API_KEY=<your_key>
36-
DATABASE_URL=postgresql://postgres:devpass@localhost:5432/postgres
37-
```
33+
```bash
34+
OPENAI_API_KEY="<your_openai_key>"
35+
GOOGLE_CLIENT_ID="<your_google_client_id>"
36+
GOOGLE_CLIENT_SECRET="<your_google_client_secret>"
37+
```
3838

39-
Migrate the database with:
39+
4. Migrate the database with:
4040

41-
```bash
42-
wasp db migrate-dev
43-
```
41+
```bash
42+
wasp db migrate-dev
43+
```
4444

45-
Then, start the server with:
45+
5. Start the server with:
4646

47-
```bash
48-
wasp start
49-
```
47+
```bash
48+
wasp start
49+
```

examples/ask-the-documents/custom-db/Dockerfile

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

examples/ask-the-documents/custom-db/extensions.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/ask-the-documents/custom-db/run_db.sh

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

examples/ask-the-documents/deploy.sh

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

examples/ask-the-documents/env.server.example

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for ask-the-documents-client on 2025-10-10T17:03:02+02:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'ask-the-documents-client'
7+
primary_region = 'cdg'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 8043
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+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax=docker/dockerfile:1
2+
# check=skip=FromPlatformFlagConstDisallowed (Fly.io only has amd64 machines)
3+
4+
# This image is published as ghcr.io/wasp-lang/ask-the-documents-fly-db
5+
# Please update the public image if you change this file.
6+
7+
FROM --platform=linux/amd64 flyio/postgres-flex:17
8+
9+
RUN <<EOF
10+
apt-get update -y
11+
apt-get install -y postgresql-$PG_MAJOR_VERSION-pgvector
12+
apt-get clean -y
13+
EOF
14+
15+
# Tell GitHub to link the image to the repo
16+
LABEL org.opencontainers.image.source=https://github.com/wasp-lang/wasp
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for ask-the-documents-server on 2025-10-10T17:02:51+02:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'ask-the-documents-server'
7+
primary_region = 'cdg'
8+
9+
[build]
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 = 1
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

0 commit comments

Comments
 (0)