Skip to content

Commit

Permalink
Explicitly set cargo-lambda env for prebuild step
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehnix committed Nov 12, 2023
1 parent 7f85d29 commit d88e0f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lambda-directly/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ WORKDIR /dist/apollo-router-lambda
COPY Cargo.toml /dist/apollo-router-lambda/Cargo.toml
COPY Cargo.lock /dist/apollo-router-lambda/Cargo.lock
COPY scaffold.rs /dist/apollo-router-lambda/src/main.rs
RUN export PATH="$HOME/.cargo/bin:$PATH"; cargo lambda build --compiler cargo --release; rm -r src; target/lambda/apollo-router-lambda/bootstrap
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
export AWS_LAMBDA_FUNCTION_NAME="_"; \
export AWS_LAMBDA_FUNCTION_VERSION=1; \
export AWS_LAMBDA_FUNCTION_MEMORY_SIZE=1024; \
export AWS_LAMBDA_RUNTIME_API=http://[::]:9000/.rt; \
cargo lambda build --compiler cargo --release; \
rm -r src; \
rm target/lambda/apollo-router-lambda/bootstrap

# Copy our actual application code and build this.
COPY src /dist/apollo-router-lambda/src
Expand Down
9 changes: 8 additions & 1 deletion lambda-with-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ WORKDIR /dist/apollo-router-lambda
COPY Cargo.toml /dist/apollo-router-lambda/Cargo.toml
COPY Cargo.lock /dist/apollo-router-lambda/Cargo.lock
COPY scaffold.rs /dist/apollo-router-lambda/src/main.rs
RUN export PATH="$HOME/.cargo/bin:$PATH"; cargo lambda build --compiler cargo --release; rm -r src; target/lambda/apollo-router-lambda/bootstrap
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
export AWS_LAMBDA_FUNCTION_NAME="_"; \
export AWS_LAMBDA_FUNCTION_VERSION=1; \
export AWS_LAMBDA_FUNCTION_MEMORY_SIZE=1024; \
export AWS_LAMBDA_RUNTIME_API=http://[::]:9000/.rt; \
cargo lambda build --compiler cargo --release; \
rm -r src; \
rm target/lambda/apollo-router-lambda/bootstrap

# Copy our actual application code and build this.
COPY src /dist/apollo-router-lambda/src
Expand Down

0 comments on commit d88e0f8

Please sign in to comment.