Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PHP_CLI_MEMORY_LIMIT envvar to configure php cli memory limit #322

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions images/php/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ COPY db-build.sh /bay
COPY db-dump-sanitized.sh /bay
COPY mtk /bay/mtk

# Change worker pool from dynamic to static. Change default value to 24.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to delete this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines being removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh just noticed these to clean up - no fpm process in the cli container so we dont need the worker config here at all. Just cruft.

The same line still exists in the fpm image.

RUN sed -i "s/pm = dynamic/pm = static/" /usr/local/etc/php-fpm.d/www.conf
ENV PHP_FPM_PM_MAX_CHILDREN=24
# Provide a separate environment variable to configure the php cli memory limit.
ENV PHP_CLI_MEMORY_LIMIT=1024M
RUN sed -i 's/\${PHP_MEMORY_LIMIT:/\${PHP_CLI_MEMORY_LIMIT:/g' "$PHP_INI_DIR/conf.d/00-lagoon-php.ini.tpl"

ARG TZ=Australia/Melbourne
RUN apk add --no-cache tzdata \
Expand Down
23 changes: 13 additions & 10 deletions images/php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ services:

## Environment Variables

| Name | Default Value | Description |
|------|---------------|-------------|
| `BAY_DISABLE_FUNCTIONS` | (see source code) | A list of PHP functions to disable. Security feature to disable potential attack vectors. |
| `BAY_UPLOAD_LIMIT` | `100M` | Payload size supported by PHP. Synchronises the value across several php configuration elements. |
| `BAY_POST_MAX` | `100M` | |
| `BAY_SESSION_NAME` | `PHPSESSID` | |
| `BAY_SESSION_COOKIE_LIFETIME` | `28800` | |
| `BAY_SESSION_STRICT` | `1` | |
| `BAY_SESSION_SID_LEN` | `256` | |
| `BAY_SESSION_SID_BITS` | `6` | |
| Name | Default Value | Description |
|------|-------------------|--------------------------------------------------------------------------------------------------|
| `BAY_DISABLE_FUNCTIONS` | (see source code) | A list of PHP functions to disable. Security feature to disable potential attack vectors. |
| `BAY_UPLOAD_LIMIT` | `100M` | Payload size supported by PHP. Synchronises the value across several php configuration elements. |
| `BAY_POST_MAX` | `100M` | |
| `BAY_SESSION_NAME` | `PHPSESSID` | |
| `BAY_SESSION_COOKIE_LIFETIME` | `28800` | |
| `BAY_SESSION_STRICT` | `1` | |
| `BAY_SESSION_SID_LEN` | `256` | |
| `BAY_SESSION_SID_BITS` | `6` | |
| `PHP_CLI_MEMORY_LIMIT` | `1024M` | Default memory_limit for CLI container. |
| `PHP_FPM_EXPORTER_ENABLED` | `false` | Toggle for php-fpm metrics exporter. |

## Ports

- 9000 - PHP FPM port
- 9253 - php-fpm_exporter metrics endpoint
Loading