@rlyle1179/serverless-aws-batch 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/docker.js +20 -6
- package/package.json +1 -1
package/lib/docker.js
CHANGED
|
@@ -61,15 +61,28 @@ function buildDockerImage() {
|
|
|
61
61
|
this.serverless.cli.log(`Building docker image: "${image}"...`);
|
|
62
62
|
|
|
63
63
|
// Get any additional run commands we'd like to include in the docker image
|
|
64
|
-
let
|
|
64
|
+
let addtionalBuildCommands = "";
|
|
65
65
|
if (this.serverless.service.custom
|
|
66
66
|
&& this.serverless.service.custom.awsBatch
|
|
67
|
-
&& this.serverless.service.custom.awsBatch.
|
|
67
|
+
&& this.serverless.service.custom.awsBatch.addtionalBuildCommands) {
|
|
68
68
|
|
|
69
69
|
_.forEach(
|
|
70
|
-
this.serverless.service.custom.awsBatch.
|
|
70
|
+
this.serverless.service.custom.awsBatch.addtionalBuildCommands,
|
|
71
71
|
runCommand => {
|
|
72
|
-
|
|
72
|
+
addtionalBuildCommands += `${runCommand}\n`;
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let additionalCommands = "";
|
|
78
|
+
if (this.serverless.service.custom
|
|
79
|
+
&& this.serverless.service.custom.awsBatch
|
|
80
|
+
&& this.serverless.service.custom.awsBatch.additionalCommands) {
|
|
81
|
+
|
|
82
|
+
_.forEach(
|
|
83
|
+
this.serverless.service.custom.awsBatch.additionalCommands,
|
|
84
|
+
runCommand => {
|
|
85
|
+
additionalCommands += `${runCommand}\n`;
|
|
73
86
|
}
|
|
74
87
|
)
|
|
75
88
|
}
|
|
@@ -86,14 +99,15 @@ function buildDockerImage() {
|
|
|
86
99
|
RUN mkdir -p /tmp/node16/
|
|
87
100
|
RUN curl -sL https://develop.apricity-health.com/assets/node-v16.20.0-linux-x64.tar.gz --output /tmp/node.tar.gz
|
|
88
101
|
RUN cd /tmp && tar xf node.tar.gz && cp -rf node-v16.20.0-linux-x64/* /tmp/node16/
|
|
89
|
-
|
|
102
|
+
${addtionalBuildCommands}
|
|
103
|
+
|
|
90
104
|
FROM justinram11/lambda:nodejs12.x
|
|
91
105
|
USER root
|
|
92
106
|
COPY --from=builder /tmp/task /var/task/
|
|
93
107
|
COPY --from=builder /tmp/node16 /var/lang/
|
|
94
108
|
ENV NODE_PATH=/var/lang/lib/node_modules:/var/task/node_modules:/var/runtime/node_modules
|
|
95
109
|
RUN node -v
|
|
96
|
-
${
|
|
110
|
+
${additionalCommands}
|
|
97
111
|
RUN rm -rf /tmp/*
|
|
98
112
|
USER sbx_user1051
|
|
99
113
|
`;
|