diff options
| author | saturneric <[email protected]> | 2025-11-02 01:03:47 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-02 01:03:47 +0000 |
| commit | 3621d3c7562030f20ae2ca7644fe716aaf1d74f7 (patch) | |
| tree | f4632d76996783119462dc220577f57d27b2d173 | |
| parent | feat(cgit): add initial config and lighttpd setup (diff) | |
| download | cgit-3621d3c7562030f20ae2ca7644fe716aaf1d74f7.tar.gz cgit-3621d3c7562030f20ae2ca7644fe716aaf1d74f7.zip | |
refactor(docker): improve build and runtime layers
* Split package installation into distinct build steps for clarity
* Update dependencies to use `lua5.4-dev`, `gettext-static`, and
reorganize install order for reliability
* Set explicit work directory to `/app` for consistency
* Copy additional filter files into runtime for feature completeness
* Improve maintainability and reproducibility of Docker builds
| -rw-r--r-- | Dockerfile | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -2,14 +2,21 @@ FROM alpine:latest AS builder COPY . /app -RUN apk --no-cache add libc-dev git gcc make openssl-dev libzip lua5.4 zlib-dev gettext-dev && \ - cd /app && \ - git submodule update --init --recursive && \ - make NO_REGEX=NeedsStartEnd install +WORKDIR /app + +RUN apk --no-cache add git && \ + git submodule update --init --recursive + +RUN apk --no-cache add libc-dev git gcc make \ + openssl-dev libzip lua5.4-dev zlib-dev \ + musl-libintl gettext-static + +RUN make NO_REGEX=NeedsStartEnd LUA_PKGCONFIG=lua5.4 install FROM alpine:latest AS runtime COPY --from=builder /var/www/htdocs/cgit /usr/share/webapps/cgit +COPY --from=builder /usr/local/lib/cgit/filters /usr/local/lib/cgit/filters RUN apk --no-cache add lighttpd |
