Skip to content

Commit b9261dd

Browse files
committed
fix: docker build
1 parent 44929fa commit b9261dd

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

azure.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ services:
1212

1313
burger-mcp:
1414
project: ./packages/burger-mcp
15+
docker:
16+
path: ./Dockerfile
17+
# We build the Dockerfile from the root of the project as we're in an NPM workspace
18+
context: ../..
1519
language: ts
1620
host: containerapp
1721

@@ -40,15 +44,6 @@ services:
4044
dist: dist
4145
language: ts
4246
host: staticwebapp
43-
# Needed to get the AGENT_API_URL env var set
44-
hooks:
45-
predeploy:
46-
windows:
47-
shell: pwsh
48-
run: npm run build
49-
posix:
50-
shell: sh
51-
run: npm run build
5247

5348
hooks:
5449
postprovision:

packages/burger-mcp/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
FROM node:22-alpine AS builder
33
WORKDIR /app
44
COPY package*.json ./
5-
RUN npm ci
6-
COPY . .
7-
RUN npm run build
5+
COPY ./packages/burger-mcp ./packages/burger-mcp
6+
RUN npm ci --workspace=burger-mcp --cache /tmp/empty-cache
7+
RUN npm run build --workspace=burger-mcp
88

99
# Production stage
1010
FROM node:22-alpine AS production
1111
WORKDIR /app
1212
COPY --from=builder /app/package*.json ./
13-
COPY --from=builder /app/lib ./lib
14-
# Remove dev dependencies and cache
15-
RUN npm ci --omit=dev && npm cache clean --force
13+
COPY --from=builder /app/packages/burger-mcp/package.json ./packages/burger-mcp/
14+
COPY --from=builder /app/packages/burger-mcp/lib ./packages/burger-mcp/lib
15+
RUN npm ci --omit=dev --workspace=burger-mcp --cache /tmp/empty-cache
1616
# Use a non-root user for security
1717
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
1818
USER appuser
1919
ENV NODE_ENV=production
2020

21-
CMD ["node", "./lib/server.js"]
21+
CMD ["node", "./packages/burger-mcp/lib/server.js"]

packages/burger-mcp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"dev:local": "tsx watch src/local.ts",
1313
"build": "tsc",
1414
"clean": "rimraf lib",
15-
"docker:build": "docker build -t burger-mcp .",
16-
"docker:run": "docker run -p 3000:3000 -e PORT=3000 burger-mcp"
15+
"docker:build": "docker build -t burger-mcp -f ./Dockerfile ../..",
16+
"docker:run": "docker run --rm -p 3000:3000 burger-mcp"
1717
},
1818
"keywords": [],
1919
"author": "Microsoft",

0 commit comments

Comments
 (0)