Skip to content

Commit

Permalink
chore(ci): reduce docker layers
Browse files Browse the repository at this point in the history
  • Loading branch information
0xawaz committed Oct 31, 2024
1 parent b2ce27e commit ba2c3c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 3 additions & 5 deletions operations/docker/ci.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ COPY package.json package-lock.json ./
RUN npm install && \
npm cache clean --force

COPY .env.example.deployment ./
# Copy the application files
COPY .env.example.deployment *.sh *.ts tsconfig.json ./
COPY lib ./lib/
COPY tasks ./tasks/
COPY gateway ./gateway/
COPY *.sh ./
COPY *.ts ./
COPY tsconfig.json ./

RUN chmod +x *.sh
RUN chmod +x *.sh
7 changes: 2 additions & 5 deletions operations/docker/dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ RUN npm install && \
npm cache clean --force

# Copy the application files
COPY .env.example.deployment ./
COPY .env.example.deployment *.sh *.ts tsconfig.json ./
COPY lib ./lib/
COPY tasks ./tasks/
COPY gateway ./gateway/
COPY *.sh ./
COPY *.ts ./
COPY tsconfig.json ./

# Set executable permissions and prepare the environment
RUN chmod +x *.sh && \
cp .env.example.deployment .env && \
./precompute-addresses.sh

# Use one RUN command to set up environment variables and compile contracts, reducing layers
# Set up environment variables and compile contracts
RUN export PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2) && \
export NUM_KMS_SIGNERS=$(grep NUM_KMS_SIGNERS .env | cut -d '"' -f 2) && \
npx hardhat clean && \
Expand Down

0 comments on commit ba2c3c6

Please sign in to comment.