Skip to content

Commit bcf2278

Browse files
committed
Add depends_on
1 parent 9c86076 commit bcf2278

File tree

11 files changed

+33
-14
lines changed

11 files changed

+33
-14
lines changed

samples/angular-express/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ services:
1111
resources:
1212
reservations:
1313
memory: 64M
14+
depends_on:
15+
- backend
1416

1517
backend:
1618
build:

samples/mcp/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ services:
1515
- MCP_SERVICE_URL=http://service-2:8000
1616
healthcheck:
1717
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
18+
depends_on:
19+
- service-2
1820

1921
service-2: # MCP Service (MCP Client and Server)
2022
build:

samples/nextjs/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ RUN npm run build
2020
EXPOSE 3000
2121

2222
# Start the app
23-
CMD ["npm", "start"]
23+
CMD ["npm", "start"]

samples/nextjs/app/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Image from "next/image";
33
export default function Home() {
44
return (
55
<main className="flex min-h-screen min-w-screen flex-col items-center justify-center bg-gradient-defang">
6-
<h1 className="text-4xl font-bold text-white">Next.js &times; Defang</h1>
6+
<h1 className="text-4xl font-bold text-white">Next.js &times; DefangA</h1>
77
</main>
88
);
99
}

samples/nextjs/compose.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
services:
22
app:
33
restart: unless-stopped
4-
# domainname: mydomain.com # if you want to use your own domain
4+
domainname: demo.cloudjam.xyz
55
build:
66
context: ./app
77
dockerfile: Dockerfile
8+
#environment:
9+
networks:
10+
default:
11+
aliases:
12+
- www.cloudjam.xyz
813

914
ports:
1015
- target: 3000
@@ -13,9 +18,9 @@ services:
1318

1419
healthcheck:
1520
test: wget -q --spider http://localhost:3000/ || exit 1
21+
interval: 10s
1622

1723
deploy:
1824
resources:
1925
reservations:
2026
cpus: '0.50'
21-
memory: 512M

samples/nounly/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ services:
1818
REDIS: redis:6379
1919
PROJECT_HONEYPOT_KEY:
2020
SHARED_SECRETS: "{}"
21+
depends_on:
22+
- redis
2123

2224
redis:
2325
restart: always

samples/ollama/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ services:
5050
# Make sure the LOAD_MODEL is the same as the app service
5151
- LOAD_MODEL=llama3.2:1b
5252
# - LOAD_MODEL=gemma:7b
53+
depends_on:
54+
- ollama

samples/rails/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
interval: 10s
2424
timeout: 5s
2525
retries: 5
26+
depends_on:
27+
- db
2628
db:
2729
restart: unless-stopped
2830
image: postgres:16

samples/vllm/compose.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
services:
22
mistral:
3+
profiles: [gpu]
34
restart: unless-stopped
45
image: ghcr.io/mistralai/mistral-src/vllm:latest
56
ports:
@@ -19,6 +20,7 @@ services:
1920
interval: 1m
2021
environment:
2122
- HF_TOKEN
23+
2224
ui:
2325
restart: unless-stopped
2426
build:
@@ -38,4 +40,6 @@ services:
3840
timeout: 2s
3941
retries: 10
4042
environment:
41-
- OPENAI_BASE_URL=http://mistral:8000/v1/
43+
- OPENAI_BASE_URL=http://echo/v1/
44+
depends_on:
45+
- mistral

samples/vllm/ui/src/app/api/chat/route.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const POST = async function (req: Request) {
1111
const docs = await fs.readFile(process.cwd() + '/src/app/docs.md', 'utf8');
1212

1313
const { messages } = await req.json();
14-
14+
1515
// log the last message
1616
console.log(messages[messages.length - 1].content);
1717

@@ -21,11 +21,11 @@ export const POST = async function (req: Request) {
2121
messages: [
2222
{
2323
role: "user",
24-
content: "Hello.",
24+
content: ["Hello."],
2525
},
2626
{
2727
role: "assistant",
28-
content: (
28+
content: [(
2929
`
3030
I am a support rep for Defang.
3131
Here is some more information about Defang:
@@ -34,17 +34,17 @@ Here is some more information about Defang:
3434
${docs}
3535
3636
----------------
37-
37+
3838
If the above context does not give you the information you need to answer support questions, I will have to direct you to the Defang documentation at https://docs.defang.io/docs/intro
3939
I will *always* answer you in 300 words or less. I promise.
4040
41-
I will also *never* break character. I will *only* respond as the support bot that I am. If you ask me something outside the scope of Defang, I will recommend that you ask a human. In such a case I will respond with:
41+
I will also *never* break character. I will *only* respond as the support bot that I am. If you ask me something outside the scope of Defang, I will recommend that you ask a human. In such a case I will respond with:
4242
4343
"Please ask a human. I am not a human. Sorry."
4444
4545
I will not respond with anything more or less than that.
4646
`
47-
),
47+
)],
4848
},
4949
...messages,
5050
],

0 commit comments

Comments
 (0)