Skip to content

Commit bd05320

Browse files
authored
Merge pull request #5 from sourceboat/feature/change_memory_limit_via_environment
Change memory limit via environment
2 parents 1950af1 + d02ea9d commit bd05320

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FROM php:7.3.8-fpm-alpine3.10
33
ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
44
PHP_OPCACHE_MAX_ACCELERATED_FILES="10000" \
55
PHP_OPCACHE_MEMORY_CONSUMPTION="192" \
6-
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10"
6+
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10" \
7+
PHP_MEMORY_LIMIT="512M"
78

89
RUN apk info \
910
&& echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A highly opinionated docker image which aims to be perfectly suited to run our L
1818

1919
Create a `Dockerfile` with the following contents (and adjust version tag):
2020

21-
```
21+
```dockerfile
2222
FROM sourceboat/docker-laravel:x.x.x
2323

2424
# install yarn dependencies
@@ -40,14 +40,15 @@ RUN yarn production
4040

4141
Create a `docker-compose.yml` with the following contents:
4242

43-
```
43+
```yml
4444
version: '3.7'
4545
services:
4646
app:
4747
build: .
4848
restart: unless-stopped
4949
environment:
5050
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
51+
- PHP_MEMORY_LIMIT=1G
5152
volumes:
5253
- ./:/opt/app:cached
5354
ports:

usr/local/etc/php/php.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
max_execution_time = 60
88
max_input_time = 60
9-
memory_limit = 512M
9+
memory_limit = ${PHP_MEMORY_LIMIT}
1010

1111
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1212
; Error handling and logging ;

0 commit comments

Comments
 (0)