Skip to content

Commit

Permalink
Set higher php memory_limit in docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Jul 15, 2020
1 parent 61e39aa commit e64d435
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

###> docker ###
PHP_URL=app:9000
PHP_MEMORY_LIMIT=512M
###< docker ###

###> app ###
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
consumer:
<< : *restart_policy
image: buddy/repman:0.4.1
command: ['bin/console', 'messenger:consume', 'async', '--limit=500']
command: ['php', '-d', 'memory_limit=-1', 'bin/console', 'messenger:consume', 'async', '--limit=500']
env_file: .env.docker
volumes:
- app-var:/app/var
Expand Down
4 changes: 2 additions & 2 deletions docker/crontabs/root
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*/5 * * * * /app/bin/console repman:proxy:sync-releases
0 */2 * * * /app/bin/console repman:security:update-db
*/5 * * * * php -d memory_limit=-1 /app/bin/console repman:proxy:sync-releases
0 */2 * * * php -d memory_limit=-1 /app/bin/console repman:security:update-db
1 change: 1 addition & 0 deletions docker/nginx/scripts/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ http {
fastcgi_pass %%PHP_URL%%;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param PHP_VALUE "memory_limit=%%PHP_MEMORY_LIMIT%%";
include fastcgi_params;
internal;
}
Expand Down
6 changes: 5 additions & 1 deletion docker/nginx/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ SUBJECT="/C=PL/ST=None/L=None/O=Repman/CN=$COMMON_NAME"

adduser -D -H -u 1000 -s /bin/bash -G www-data www-data

sed s/%%PHP_URL%%/${PHP_URL}/g < /nginx/nginx.conf > /etc/nginx/nginx.conf
sed \
-e s/%%PHP_URL%%/${PHP_URL}/g \
-e s/%%PHP_MEMORY_LIMIT%%/${PHP_MEMORY_LIMIT}/g \
< /nginx/nginx.conf \
> /etc/nginx/nginx.conf

function generate_certificate {
echo "Generating self-signed certificate for domain: ${APP_HOST}..."
Expand Down

0 comments on commit e64d435

Please sign in to comment.