aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-11-02 01:03:47 +0000
committersaturneric <[email protected]>2025-11-02 01:03:47 +0000
commit3621d3c7562030f20ae2ca7644fe716aaf1d74f7 (patch)
treef4632d76996783119462dc220577f57d27b2d173
parentfeat(cgit): add initial config and lighttpd setup (diff)
downloadcgit-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--Dockerfile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index b360923..9e5aecf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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