diff options
| author | saturneric <[email protected]> | 2025-11-02 00:28:01 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-02 00:28:01 +0000 |
| commit | 2f361a0e62fefd2ddcbeb4508acaf7dba30bb6f2 (patch) | |
| tree | 8dd1bd752aa43bdace4045e2c76cbb83a74581b8 | |
| parent | feat(docker): add initial `Dockerfile` for build setup (diff) | |
| download | cgit-2f361a0e62fefd2ddcbeb4508acaf7dba30bb6f2.tar.gz cgit-2f361a0e62fefd2ddcbeb4508acaf7dba30bb6f2.zip | |
feat(docker): split build and runtime stages
* Separate build and runtime environments to streamline image layers
* Add missing dev dependencies for building and runtime dependencies for serving
* Use `lighttpd` as the runtime web server and move configuration files
* Pass custom build option to `make` for improved compatibility
| -rw-r--r-- | Dockerfile | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1,9 +1,20 @@ -FROM alpine:latest as builder +FROM alpine:latest AS builder COPY . /app -RUN apk --no-cache add git gcc make openssl libzip lua5.4 nginx && \ +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 && \ - make install
\ No newline at end of file + make NO_REGEX=NeedsStartEnd install + +FROM alpine:latest AS runtime + +COPY --from=builder /var/www/htdocs/cgit /usr/share/webapps/cgit + +RUN apk --no-cache add lighttpd + +COPY lighttpd.conf /etc/lighttpd/lighttpd.conf +COPY cgitrc /etc/cgitrc +COPY cgitrepos /etc/cgitrepos + +ENTRYPOINT [ "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf" ]
\ No newline at end of file |
