Skip to content

Commit

Permalink
UPLOAD_MAX_FILESIZE with unit
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Dec 18, 2023
1 parent 7fae66e commit 6069e94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"options": {
"admin": {
"memory_limit": "256M",
"upload_max_filesize": "50M",
"post_max_size": "50M"
"upload_max_filesize": "$UPLOAD_MAX_FILESIZE",
"post_max_size": "$UPLOAD_MAX_FILESIZE"
}
},
"processes": {
Expand All @@ -70,7 +70,7 @@
},
"settings": {
"http": {
"max_body_size": 104857600
"max_body_size": 1048576000
}
}
}
2 changes: 2 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ chown shimmie:shimmie /app/data

rm -rf /var/lib/unit/*

envsubst '$UPLOAD_MAX_FILESIZE' < /app/.docker/entrypoint.d/config.json.tmpl > /app/.docker/entrypoint.d/config.json

WAITLOOPS=5
SLEEPSEC=1

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ thumbs
*.sqlite
*.cache
trace.json
.docker/entrypoint.d/config.json

#Composer
composer.phar
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ RUN echo 'deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages
RUN apt update && apt install -y \
php${PHP_VERSION}-cli php${PHP_VERSION}-gd php${PHP_VERSION}-zip php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-sqlite3 \
gosu curl imagemagick ffmpeg zip unzip git unit unit-php
RUN apt update && apt install -y procps net-tools
gosu curl imagemagick ffmpeg zip unzip git unit unit-php gettext procps net-tools

# Composer has 100MB of dependencies, and we only need that during build and test
FROM base AS composer
Expand Down Expand Up @@ -49,7 +48,7 @@ EXPOSE 8000
FROM base AS run
EXPOSE 8000
HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1
ENV UID=1000 GID=1000
ENV UID=1000 GID=1000 UPLOAD_MAX_FILESIZE=50M
COPY --from=build /app /app
ENTRYPOINT ["/app/.docker/entrypoint.sh"]
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0 comments on commit 6069e94

Please sign in to comment.