Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Improve caching of docker layersΒ #227

@bajtos

Description

@bajtos

Rework Dockerfile to use the same structure as we have in spark-api: https://github.com/filecoin-station/spark-api/blob/main/Dockerfile

The current Dockerfile script is slowing down our deployment.

 => CACHED [build 1/5] RUN apt-get update -qq && 
    apt-get install -y python-is-python3 pkg-config build-essential                                                                                    
 => CACHED [build 2/5] COPY --link package.json package-lock.json .                                                                                                                                     
 => CACHED [build 3/5] RUN npm install --production=false                                                                                                                                               
 => [build 4/5] COPY --link . .                                                                                                                                                                         
 => [build 5/5] RUN npm prune --production

Notice that Docker loaded the first three layers from the cache. Then we copied the modified files, this was not cached as expected. As a result, layer 5 (the npm prune step) had to be recomputed again.

Metadata

Metadata

Assignees

Projects

Status

πŸ—ƒ backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions