Skip to content

Commit 8b611c5

Browse files
Merge pull request #593 from DefangLabs/jordan/compose-project-names
add project names and deploy resources to all samples
2 parents cd904d0 + 75cc654 commit 8b611c5

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

compose.yaml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
1+
name: mastra-nextjs
12
services:
23
app:
34
x-defang-llm: true
45
build:
56
context: ./app
67
dockerfile: Dockerfile
78
environment:
8-
- DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
9-
- DB_SSL # set this to true if deploying to AWS and GCP, otherwise it is false deploying to Defang Playground
10-
- LLM_MODEL # recommended gemini-2.5-flash for GCP or anthropic.claude-3-5-sonnet-20241022-v2:0 for AWS
11-
- GITHUB_TOKEN # remove this line if unused; optional, but recommended to avoid rate limiting when fetching from GitHub
9+
- DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
10+
- DB_SSL
11+
- LLM_MODEL
12+
- GITHUB_TOKEN
1213
restart: unless-stopped
1314
ports:
14-
- mode: ingress
15-
target: 3000
16-
published: 3000
15+
- mode: ingress
16+
target: 3000
17+
published: 3000
1718
healthcheck:
18-
test: ["CMD", "curl", "-f", "http://localhost:3000"]
19+
test:
20+
- CMD
21+
- curl
22+
- -f
23+
- http://localhost:3000
1924
depends_on:
20-
- database
21-
25+
- database
26+
deploy:
27+
resources:
28+
reservations:
29+
cpus: '0.5'
30+
memory: 512M
2231
database:
2332
image: postgres:16
2433
x-defang-postgres: true
2534
restart: always
2635
environment:
27-
- POSTGRES_PASSWORD
28-
- POSTGRES_DB=postgres
29-
- POSTGRES_USER=postgres
36+
- POSTGRES_PASSWORD
37+
- POSTGRES_DB=postgres
38+
- POSTGRES_USER=postgres
3039
ports:
31-
- mode: host
32-
target: 5432
40+
- mode: host
41+
target: 5432
3342
healthcheck:
34-
test: ["CMD-SHELL", "pg_isready -h localhost -U postgres -d postgres"]
43+
test:
44+
- CMD-SHELL
45+
- pg_isready -h localhost -U postgres -d postgres
3546
interval: 5s
3647
timeout: 5s
3748
retries: 10
49+
deploy:
50+
resources:
51+
reservations:
52+
cpus: '0.5'
53+
memory: 512M

0 commit comments

Comments
 (0)