Every stage (command) in a dockerfile is individually cached and only reexecuted if a previous step had to be reexecuted as well.
It thus makes sense to include those steps in the dockerfile later that change more often.
optimize-dockerfile into dev Every stage (command) in a dockerfile is individually cached and only reexecuted if a previous step had to be reexecuted as well.
It thus makes sense to include those steps in the dockerfile later that change more often.
Added: - justfile for easier building - loading config from specific file Reviewed-on: mjh/LibRate#36 Co-authored-by: MJH <1a6f1a@riseup.net> Co-committed-by: MJH <1a6f1a@riseup.net>
8fc6a596db
to 381db7bdba
please base your changes against the dev branch. It should be easier to review. Then we should consider merging dev into main if things don't turn out to be less stable than they were since the last update to main.
@ -12,0 +8,4 @@
WORKDIR /app
COPY ./fe /app/fe
RUN cd fe && npm install
this is duplicate of just build_frontend from line 18
No, it is not.
As I mention in the description of this PR, docker caches the build process in stages and uses the cached stages unless a previous stage has been changed.
It is thus important, for a faster cached build process, to build the frontend when only the frontend code is included in the docker image - thus caching this step in the build process whenever no change to the frontend code has taken place.
so should the second build step, where we use just to do precisely the same but with a small added overhead of wrapping it in an one-liner that checks for presence of pnpm, which outside of dockerized environments, is slightly faster than npm, be removed?
@ -23,1 +24,4 @@
EXPOSE 3000
# initialize the database, don't launch the database subprocess and rely solely on pg_isready, run the migrations
#"migrate", "-auto-migrate, -init" flags were all removed as they were causing issues.
ENTRYPOINT ["/app/bin/librate", "-no-db-subprocess", "-hc-extern", "-config=/app/data/config.yml"]
please reconsider adding the init flag, it should work after the recent changes and as indicated by the unit tests
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?