File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 3636
3737 - name : Build and push editor-api image
3838 run : |
39- docker build -t ${{ steps.registry.outputs.registry }}/app-scripting-editor-api:latest ./server/server
39+ docker build -t ${{ steps.registry.outputs.registry }}/app-scripting-editor-api:latest ./server
4040 docker push ${{ steps.registry.outputs.registry }}/app-scripting-editor-api:latest
4141
4242 deploy-to-appservice :
Original file line number Diff line number Diff line change 1+ # Dockerfile for editor mock API (TypeScript/Express)
2+ FROM node:18-alpine AS build
3+ WORKDIR /app
4+ # Copy only package.json from the build context. The repo root package-lock.json
5+ # is not available when building from the subfolder context, which caused
6+ # BuildKit checksum errors. Use npm ci when a lockfile exists, otherwise
7+ # fall back to npm install so the build doesn't fail.
8+ COPY package.json ./
9+ RUN npm ci --production=false || npm install --production=false
10+ COPY tsconfig.json ./
11+ COPY src ./src
12+ RUN npm run build
13+
14+ FROM node:18-alpine
15+ WORKDIR /app
16+ # Install only production deps
17+ COPY package.json ./
18+ # If a package-lock.json is present, npm ci will be used; if not, fall back
19+ # to npm install so the build doesn't fail when the lockfile is absent in the
20+ # build context (common when CI checkouts or subfolders don't include it).
21+ RUN npm ci --production || npm install --production
22+ COPY --from=build /app/dist ./dist
23+ EXPOSE 4000
24+ CMD ["node" , "dist/index.js" ]
Original file line number Diff line number Diff line change 11{
2- "name" : " app-scripting-server" ,
2+ "name" : " app-scripting-editor- server" ,
33 "version" : " 0.1.0" ,
44 "private" : true ,
55 "main" : " dist/index.js" ,
1414 },
1515 "devDependencies" : {
1616 "@types/express" : " ^4.17.17" ,
17+ "@types/cors" : " ^2.8.12" ,
1718 "@types/node" : " ^18.0.0" ,
1819 "ts-node-dev" : " ^2.0.0" ,
1920 "typescript" : " ^5.0.4"
You can’t perform that action at this time.
0 commit comments