Speed up docker build by caching rpc file downloads. (#12)

This commit is contained in:
Jonathan Zernik 2020-03-22 23:37:02 -07:00 committed by GitHub
parent 10227fa1aa
commit 890fb68c7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -11,8 +11,17 @@ COPY requirements.txt /
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
# Download the rpc files.
RUN git clone https://github.com/googleapis/googleapis.git
RUN curl -o rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
# Copy the source code.
COPY . /app
# Copy the source code.
RUN cp -r googleapis /app
RUN cp rpc.proto /app
WORKDIR /app
# Install the gRPC files.

View file

@ -1,7 +1,12 @@
#!/usr/bin/env bash
git clone https://github.com/googleapis/googleapis.git
curl -o rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
if [ ! -d "googleapis" ]; then
git clone https://github.com/googleapis/googleapis.git
fi
if [ ! -f "rpc.proto" ]; then
curl -o rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
fi
cp rpc.proto squeaknode/common