Skip to content

Commit

Permalink
removed package.json and implemeneted npm install of versioned proxy-…
Browse files Browse the repository at this point in the history
…agent
  • Loading branch information
ryparker committed Oct 20, 2021
1 parent 1fa1876 commit 651f906
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
build.sh
.no-packagejson-validator
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# base lambda image
FROM public.ecr.aws/lambda/nodejs:latest

ARG PROXY_AGENT_VERSION=5.0.0

USER root
RUN mkdir -p /opt
WORKDIR /tmp
Expand All @@ -17,8 +19,7 @@ RUN yum update -y \
#

RUN mkdir -p /opt/nodejs
COPY package.json /opt/nodejs
RUN cd /opt/nodejs && npm install
RUN cd /opt/nodejs && npm install proxy-agent@${PROXY_AGENT_VERSION}

#
# create the bundle
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class NodeProxyAgentLayer extends lambda.LayerVersion {
constructor(scope: Construct, id: string) {
super(scope, id, {
code: lambda.Code.fromAsset(path.join(__dirname, 'layer.zip'), {
// we hash the package.json (it contains the tools versions) because hashing the zip is non-deterministic
assetHash: hashFile(path.join(__dirname, '..', 'layer', 'package.json')),
// we hash the Dockerfile (it contains the tools versions) because hashing the zip is non-deterministic
assetHash: hashFile(path.join(__dirname, '..', 'layer', 'Dockerfile')),
}),
description: '/opt/nodejs/node_modules/proxy-agent',
});
Expand Down

0 comments on commit 651f906

Please sign in to comment.