forked from shutterstock/public-api-sdk-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (17 loc) · 764 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (17 loc) · 764 Bytes
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
FROM node:10 as swagger-build
RUN mkdir -p /opt/swagger-build/build/swagger
WORKDIR /opt/swagger-build
COPY build/swagger/openapiToSwagger.js ./build/swagger/openapiToSwagger.js
COPY package.json .
COPY openapi.json .
RUN yarn install
RUN node build/swagger/openapiToSwagger.js
######################################
FROM swaggerapi/swagger-codegen-cli:2.4.9 as sdk-build
RUN mkdir -p /opt/node-sdk/dist
WORKDIR /opt/node-sdk
COPY --from=swagger-build /opt/swagger-build/swagger2.json .
COPY build/sdk/js/templates ./build/sdk/js/templates
COPY build/sdk/config.json .
RUN java -jar /opt/swagger-codegen-cli/swagger-codegen-cli.jar generate -i ./swagger2.json -o ./dist -c ./config.json -l javascript -t ./build/sdk/js/templates
ENTRYPOINT ["/bin/sh"]