feat: first version
Change-Id: I5ebf29edd76752d5600cf63b39ee284711690e8c
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..c4e9b42
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.avm99963.com
+project=docker/lighttpd
+defaultbranch=main
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..b847670
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,41 @@
+FROM alpine:3.20.1 AS builder
+
+ARG LIGHTTPD_TARBALL="https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.76.tar.gz"
+ARG LIGHTTPD_SHA256="ba14a030889518194fd88b33e419d51cc38c8fe917126d5a7a965be79b53e995"
+
+RUN set -eux; \
+ \
+ apk add --no-cache \
+ bsd-compat-headers \
+ build-base \
+ pcre2-dev \
+ scons
+
+RUN set -eux; \
+ \
+ wget -O lighttpd.tar.gz "$LIGHTTPD_TARBALL"; \
+ echo "$LIGHTTPD_SHA256 *lighttpd.tar.gz" | sha256sum -c; \
+ mkdir -p /usr/src/lighttpd; \
+ tar -xzf lighttpd.tar.gz -C /usr/src/lighttpd --strip-components=1; \
+ rm lighttpd.tar.gz; \
+ cd /usr/src/lighttpd; \
+ nproc="$(getconf _NPROCESSORS_ONLN)"; \
+ eval "scons -j '$nproc' build_fullstatic=1 build_dynamic=0"
+
+RUN set -eux; \
+ \
+ mkdir -p /rootfs/bin; \
+ cp /usr/src/lighttpd/sconsbuild/fullstatic/build/lighttpd /rootfs/bin/; \
+ mkdir -p /rootfs/etc; \
+ echo "nogroup:*:10001:nobody" > /rootfs/etc/group; \
+ echo "nobody:*:10001:10001:::" > /rootfs/etc/passwd
+
+
+FROM scratch
+
+COPY --from=builder --chown=10001:10001 /rootfs /
+
+USER 10001:10001
+
+ENTRYPOINT ["/bin/lighttpd"]
+CMD ["-D", "-f", "/lighttpd.conf"]
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..9eb8533
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2024 Adrià Vilanova Martínez (@avm99963)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a2cbf56
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+MUTABLE_VERSION ?= latest
+VERSION ?= $(shell git rev-parse --short HEAD)
+
+IMAGE_INTERNAL := docker-registry.corp.avm99963.com/lighttpd
+
+docker-prod: Dockerfile
+ docker build --force-rm -f Dockerfile --tag=$(IMAGE_INTERNAL):$(VERSION) .
+ docker tag $(IMAGE_INTERNAL):$(VERSION) $(IMAGE_INTERNAL):$(MUTABLE_VERSION)
+
+push-prod: docker-prod
+ docker push $(IMAGE_INTERNAL):$(VERSION)
+ docker push $(IMAGE_INTERNAL):$(MUTABLE_VERSION)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fe7e559
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+# docker/lighttpd
+
+Simple image which provides lighttpd.
+
+## Usage
+
+You should provide your configuration at `/lighttpd.conf`.
+
+## Acknowledgements
+
+Inspired by https://github.com/ricardbejarano/lighttpd.