[docker] accept MAX_FILE_UPLOADS as a docker environment variable

This commit is contained in:
Shish 2024-02-21 11:58:37 +00:00 committed by Shish
parent b407bad7c5
commit a77c31b2cb
4 changed files with 4 additions and 2 deletions

View file

@ -28,6 +28,7 @@
"UID": "2000", "UID": "2000",
"GID": "2000", "GID": "2000",
"UPLOAD_MAX_FILESIZE": "50M", "UPLOAD_MAX_FILESIZE": "50M",
"MAX_FILE_UPLOADS": "100",
"INSTALL_DSN": "sqlite:data/shimmie.dev.sqlite" "INSTALL_DSN": "sqlite:data/shimmie.dev.sqlite"
}, },
"customizations": { "customizations": {

View file

@ -57,6 +57,7 @@
"options": { "options": {
"admin": { "admin": {
"memory_limit": "256M", "memory_limit": "256M",
"max_file_uploads": "$MAX_FILE_UPLOADS",
"upload_max_filesize": "$UPLOAD_MAX_FILESIZE", "upload_max_filesize": "$UPLOAD_MAX_FILESIZE",
"post_max_size": "$UPLOAD_MAX_FILESIZE" "post_max_size": "$UPLOAD_MAX_FILESIZE"
} }

View file

@ -12,7 +12,7 @@ chown shimmie:shimmie /app/data
rm -rf /var/lib/unit/* rm -rf /var/lib/unit/*
envsubst '$UPLOAD_MAX_FILESIZE' < /app/.docker/entrypoint.d/config.json.tmpl > /app/.docker/entrypoint.d/config.json envsubst < /app/.docker/entrypoint.d/config.json.tmpl > /app/.docker/entrypoint.d/config.json
WAITLOOPS=5 WAITLOOPS=5
SLEEPSEC=1 SLEEPSEC=1

View file

@ -68,7 +68,7 @@ FROM base AS run
EXPOSE 8000 EXPOSE 8000
# HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1 # HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1
ARG BUILD_TIME=unknown BUILD_HASH=unknown ARG BUILD_TIME=unknown BUILD_HASH=unknown
ENV UID=1000 GID=1000 UPLOAD_MAX_FILESIZE=50M ENV UID=1000 GID=1000 UPLOAD_MAX_FILESIZE=50M MAX_FILE_UPLOADS=100
COPY --from=build /app /app COPY --from=build /app /app
WORKDIR /app WORKDIR /app
RUN echo "_d('BUILD_TIME', '$BUILD_TIME');" >> core/sys_config.php && \ RUN echo "_d('BUILD_TIME', '$BUILD_TIME');" >> core/sys_config.php && \