diff --git a/Dockerfile b/Dockerfile index 037dc53..33b593d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.21 RUN \ apk --no-cache upgrade && \ - apk --no-cache add tini nginx curl openssh-server nginx-mod-http-dav-ext \ + apk --no-cache add tini nginx curl logrotate openssh-server nginx-mod-http-dav-ext \ php84 php84-fpm php84-mbstring php84-curl php84-ctype php84-dom php84-gd php84-json php84-openssl php84-session php84-simplexml php84-xml php84-zip \ php84-apcu php84-opcache php84-pecl-yaml php84-sqlite3 php84-mysqli \ php83 php83-fpm php83-mbstring php83-curl php83-ctype php83-dom php83-gd php83-json php83-openssl php83-session php83-simplexml php83-xml php83-zip \ diff --git a/README.md b/README.md index c295dc0..6b913dd 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,12 @@ services: - 8888:80 - 2222:22 volumes: - - ./www:/data/www + - ./data:/data - ./ssh:/ssh # add authorized_keys file here - ./extra_nginx.conf:/etc/nginx/custom.d/extra.conf # optional - ./htpasswd:/app/htpasswd # optional, for webdav auth environment: + LOG_DAYS: 14 # default 7 WEBDAV_PORT: 8080 # default: 8080 PHP: php84 # none (default), php82, php83, php84 POSTSIZE: 256M # default: 256M @@ -31,4 +32,4 @@ services: FPM_MAX_SPARE_SERVERS: 3 # default: 3 ``` -The `/data/www` directory and its contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start. +The `/data/www` and `/data/logs` directories and their contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start. diff --git a/rootfs/app/entrypoint.sh b/rootfs/app/entrypoint.sh index 9eb8dfa..9a43027 100755 --- a/rootfs/app/entrypoint.sh +++ b/rootfs/app/entrypoint.sh @@ -128,5 +128,24 @@ touch /app/htpasswd mkdir -p /data/logs chown -R "${USERNAME}" /data/logs +# configure logrotate +LOG_DAYS=${LOG_DAYS:-7} +cat >/etc/logrotate.d/nginx <