add root-folder and files, Dockerfile and docker-compose.yml
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 13s
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 13s
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -0,0 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM git.pi-farm.de/pi-farm/docker-baseimage-alpine:3.23
|
||||
|
||||
LABEL description="Alpine Baseimage mit s6-overlay und lighttpd"
|
||||
LABEL build_version="Pi-Farm version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="Pi-Farm"
|
||||
|
||||
RUN apk add --no-cache \
|
||||
lighttpd \
|
||||
lighttpd-mod_auth
|
||||
|
||||
COPY root/ /
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
VOLUME ["/config"]
|
||||
|
||||
ENTRYPOINT ["/init"]
|
||||
@@ -1,7 +1,9 @@
|
||||
services:
|
||||
docker-baseimage-alpine-lighttpd:
|
||||
image: git.pi-farm.de/pi-farm/docker-baseimage-alpine-lighttpd:1.0
|
||||
image: git.pi-farm.de/pi-farm/docker-baseimage-alpine-lighttpd:1.4.82
|
||||
container_name: docker-baseimage-alpine-lighttpd
|
||||
volume:
|
||||
- ./config:/config
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
|
||||
22
root/defaults/lighttpd.conf
Normal file
22
root/defaults/lighttpd.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server.document-root = "/app/www"
|
||||
|
||||
server.port = 80
|
||||
|
||||
server.username = "abc"
|
||||
server.groupname = "users"
|
||||
|
||||
# Mime Types laden (wichtig für CSS/JS)
|
||||
include "/etc/lighttpd/mime-types.conf"
|
||||
|
||||
# Module laden
|
||||
server.modules += ( "mod_access", "mod_accesslog" )
|
||||
|
||||
# Index Dateien
|
||||
index-file.names = ( "index.html" )
|
||||
|
||||
# Logging nach stdout/stderr für Docker
|
||||
server.errorlog = "/dev/stderr"
|
||||
accesslog.filename = "/dev/stdout"
|
||||
|
||||
# Verhindert, dass Lighttpd im Hintergrund läuft (wichtig für s6)
|
||||
server.event-handler = "linux-sysepoll"
|
||||
19
root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/run
Executable file
19
root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/run
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/command/with-contenv bash
|
||||
|
||||
# Standard-Verzeichnisse erstellen
|
||||
mkdir -p /config /app/www
|
||||
|
||||
# Config kopieren, falls nicht vorhanden
|
||||
if [ ! -f /config/lighttpd.conf ]; then
|
||||
echo "Keine Konfiguration gefunden, kopiere Standard..."
|
||||
cp /defaults/lighttpd.conf /config/lighttpd.conf
|
||||
fi
|
||||
|
||||
# Dummy Index-Datei erstellen, falls leer
|
||||
if [ ! -f /app/www/index.html ]; then
|
||||
echo "<h1>Es funktioniert!</h1><p>Lighttpd auf Alpine.</p>" > /app/www/index.html
|
||||
fi
|
||||
|
||||
# Berechtigungen korrigieren (für User abc)
|
||||
chown -R abc:users /config
|
||||
chown -R abc:users /app/www
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-lighttpd-config/type
Normal file
@@ -0,0 +1 @@
|
||||
oneshot
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/dependencies
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/dependencies
Normal file
@@ -0,0 +1 @@
|
||||
init-lighttpd-config
|
||||
3
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/run
Executable file
3
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/run
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/command/with-contenv bash
|
||||
# Startet lighttpd im Vordergrund (-D) mit der Config aus dem Volume
|
||||
exec lighttpd -D -f /config/lighttpd.conf
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-lighttpd/type
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
||||
Reference in New Issue
Block a user