forked from SAP-archive/cloud-s4-sdk-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (21 loc) · 753 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Build docker image of mock server by passing in "--build-arg API_KEY=<API key from SAP API Business Hub>"
## ----
## Builder to hide credentials from image
FROM alpine:latest AS builder
RUN apk add patch curl libxml2-utils
ARG API_KEY
RUN curl -H "apikey: $API_KEY"\
"https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/\$metadata"\
| xmllint --format - > API_BUSINESS_PARTNER.edmx
COPY business-partner/API_BUSINESS_PARTNER.patch .
RUN patch API_BUSINESS_PARTNER.edmx API_BUSINESS_PARTNER.patch
## Node.js app
FROM node:8
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
COPY --from=builder API_BUSINESS_PARTNER.edmx business-partner/
ENV PORT 8080
EXPOSE 8080
CMD [ "npm", "start" ]